Page 1 of 1

set statement not setting

Posted: Sat Apr 03, 2004 10:20 pm
by m3rajk
either i've been at this too long or my server has gone batso or zend has to eplain something....namely: why the HELL have i just spent 30 minutes trying to get $uid to be set to $_GET['uid'] playing with trying to pass it when it's set like mem and there's definitely something in the string....... here, pardon the writing in the code, i'm just a tad bit <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> at this rght now..

Code: Select all

/* passed & default variables */
$uid=$_GET['uid']; $mem=$_GET['mem']; $fn=''; $beid=NULL; $gmto='-5'; $utds='m/d/Y H:i:s'; $el='';
$disp="     <td class="abcen">$mem has no journal entries</td>"; $sa=$vis; $uid=NULL; $errs=array();
if(isset($_GET['fn'])){ $fn=$_GET['fn']; }else{ $fn=$_POST['fn']; } # set the function
if(isset($_GET['entry'])){ $beid=$_GET['entry']; }else{ $beid=$_POST['entry']; } # set the blog entry id
if(isset($_COOKIE['gmto'])){ $gmto=$_COOKIE['gmto']; } # set member's utc offset (in hours)
if(isset($_COOKIE['utds'])){ $utds=$_COOKIE['utds']; } # set member's choice of time display style
echo "<h1> the uid is: $uid</h1><h2><span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span> get is <span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span>: {$_GET['uid']}</h2>";
which gets
the uid is:
<span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span> get is <span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span>: 1

Posted: Sat Apr 03, 2004 10:26 pm
by d3ad1ysp0rk
comment everything out.

just have:

Code: Select all

$uid = $_GET['uid'];
echo $uid;

Posted: Sat Apr 03, 2004 10:33 pm
by m3rajk
odd that worked

Posted: Sat Apr 03, 2004 10:35 pm
by m3rajk
but as soon as i add the rest it's unset
by the time i get to that line it's unset. WHY????

Posted: Sat Apr 03, 2004 10:45 pm
by m3rajk
never mind. i've been restructureing the database and a small little thing left over from the othr structure is what was causing it....

Posted: Sat Apr 03, 2004 10:46 pm
by d3ad1ysp0rk
Well.. I added some line breaks and found this:

Code: Select all

$uid=NULL;
Hope that teaches you to code neater ;)

Posted: Mon Apr 05, 2004 3:52 am
by twigletmac

Code: Select all

$uid=$_GET['uid']; $mem=$_GET['mem']; $fn=''; $beid=NULL; $gmto='-5'; $utds='m/d/Y H:i:s'; $el='';
OT: 7 statements on one line is a debugging nightmare waiting to happen. Good coding is not about cramming as much as possible into as smaller space as possible ;) .

Mac