...

View Full Version : IF statement in PHP?



jarv
07-19-2008, 04:15 PM
is my code ok?!


if ($_SESSION["RSUSER"] = "admin");
{
echo "<a href=\"edit.php?PUBID=$PUBID\" class=\"small\">edit this pub</a>";
}


I want to only show the edit link if Admin is logged in!

can anyone help me please???

ole90
07-19-2008, 04:17 PM
change the = to ==

jarv
07-19-2008, 04:38 PM
I did that and it still didn't work?!

jarv
07-19-2008, 04:48 PM
I can see the edit text even if i am logged in as another member

CFMaBiSmAd
07-19-2008, 04:53 PM
The semi-colon on the end of the if() line terminates the if statement. A semi-colon does not belong there.

Ref: http://www.php.net/manual/en/control-structures.if.php

jarv
07-19-2008, 05:36 PM
thanks, i thanked you!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum