set statement not setting

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

set statement not setting

Post 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
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

comment everything out.

just have:

Code: Select all

$uid = $_GET['uid'];
echo $uid;
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

odd that worked
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post 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????
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post 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....
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

Well.. I added some line breaks and found this:

Code: Select all

$uid=NULL;
Hope that teaches you to code neater ;)
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
Post Reply