simcoweb Posted September 21, 2006 Share Posted September 21, 2006 I have a registration form that, if registration is successful, starts and sets the session ID. What I want to do is have it check if the session has already been started so that they don't try to register twice in the same session. if (!$_SESSION['loggedin'] == true) { header("Location: login.php");} else{blah blah proceed with registration}I'm just not sure on my syntax but that's the jist of what I need. Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted September 21, 2006 Share Posted September 21, 2006 That should work. Quote Link to comment Share on other sites More sharing options...
simcoweb Posted September 21, 2006 Author Share Posted September 21, 2006 Ok, thanks. But maybe it should be an isset function?if (isset($_SESSION['loggedin'])){ header("Location: login.php");} else { run code blah blah;} Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted September 21, 2006 Share Posted September 21, 2006 Could be, but doesn't really matter. If it is true then it is set, right ;) Quote Link to comment Share on other sites More sharing options...
simcoweb Posted September 21, 2006 Author Share Posted September 21, 2006 heh...well, it only matters if the code works ;) I'm going to use the isset function and see how things progress from there. Thanks! Quote Link to comment 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.