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 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. 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 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. 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
Archived
This topic is now archived and is closed to further replies.