desjardins2010 Posted December 8, 2010 Share Posted December 8, 2010 <?php session_start(); if($_SESSION['username']) echo "Welcome, ".$_SESSION['username']."!<BR>"; echo "<a href=\"logout.php\">LOGOUT</a>"; else die("Your Have To Be Logged In To View This Page"); ?> anyone see anything wrong with this i'm getting a parse error on line 8 that is the else statment Quote Link to comment https://forums.phpfreaks.com/topic/221059-not-sure-why-this-code-isnt-working/ Share on other sites More sharing options...
Maq Posted December 8, 2010 Share Posted December 8, 2010 The IF without braces only works for the line directly under it. You should be using braces for your IF and ELSE blocks. Quote Link to comment https://forums.phpfreaks.com/topic/221059-not-sure-why-this-code-isnt-working/#findComment-1144609 Share on other sites More sharing options...
desjardins2010 Posted December 8, 2010 Author Share Posted December 8, 2010 thanks, my stupidness.. lol is that a work haha Quote Link to comment https://forums.phpfreaks.com/topic/221059-not-sure-why-this-code-isnt-working/#findComment-1144611 Share on other sites More sharing options...
Maq Posted December 8, 2010 Share Posted December 8, 2010 thanks, my stupidness.. lol is that a work haha It's better format for readability purposes as well. Quote Link to comment https://forums.phpfreaks.com/topic/221059-not-sure-why-this-code-isnt-working/#findComment-1144613 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.