TheJoey Posted October 5, 2009 Share Posted October 5, 2009 im trying to give a error message if(!$_SESSION["loginsuccessfull"]) { echo 'Your Already Registered, Only one account allowed'; else Function showform() } Parse error: syntax error, unexpected T_ELSE Thanks in advance guys Link to comment https://forums.phpfreaks.com/topic/176527-solved-session-redirect/ Share on other sites More sharing options...
TheJoey Posted October 5, 2009 Author Share Posted October 5, 2009 i fixed the syntax, is still showing my form when im logged in though. Link to comment https://forums.phpfreaks.com/topic/176527-solved-session-redirect/#findComment-930537 Share on other sites More sharing options...
jon23d Posted October 5, 2009 Share Posted October 5, 2009 To clarify then, you now have: if (!$_SESSION['loginsuccessfull']) { echo "You are logged in"; } else { showForm(); } ??? Link to comment https://forums.phpfreaks.com/topic/176527-solved-session-redirect/#findComment-930539 Share on other sites More sharing options...
TheJoey Posted October 5, 2009 Author Share Posted October 5, 2009 Correct, but its still showing my form. Mabye im not identifying the session id correctly $_SESSION['loginsuccessfull'] = true; header("location: loginsuccess.php"); } else { header("location: unsuccess.php"); is everything fine with that, im completly stuck Link to comment https://forums.phpfreaks.com/topic/176527-solved-session-redirect/#findComment-930543 Share on other sites More sharing options...
jon23d Posted October 5, 2009 Share Posted October 5, 2009 Are you calling session_start()? Link to comment https://forums.phpfreaks.com/topic/176527-solved-session-redirect/#findComment-930546 Share on other sites More sharing options...
TheJoey Posted October 5, 2009 Author Share Posted October 5, 2009 yup at the top of my page Link to comment https://forums.phpfreaks.com/topic/176527-solved-session-redirect/#findComment-930547 Share on other sites More sharing options...
TheJoey Posted October 5, 2009 Author Share Posted October 5, 2009 The problem was i was calling it twice. Thanks for that. Link to comment https://forums.phpfreaks.com/topic/176527-solved-session-redirect/#findComment-930549 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.