if, else

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
Colwell
Forum Newbie
Posts: 6
Joined: Fri Nov 06, 2009 2:12 pm

if, else

Post by Colwell »

I'm pretty confused here, I've got
if($_SESSION['regis']==1)
Some code here
else
more code
and when I run it I get this error
Parse error: syntax error, unexpected T_ELSE in /www/uuuq.com/c/o/l/colwell/htdocs/welcome.php on line 14
guru2k9
Forum Newbie
Posts: 9
Joined: Fri Oct 30, 2009 6:24 am

Re: if, else

Post by guru2k9 »

Hi

Please check the session value,before the if condition.
Whether the value to the session is there or not.
Or try this
if($_SESSION['regis']=='1')

Thanks
Post Reply