spooke2k Posted June 8, 2007 Share Posted June 8, 2007 what am i doing wrong php on the first login php page if (mysql_num_rows($userselect) > 0) { $row=mysql_num_rows($userselect); echo "You are logged in as $userselect <br>"; $URL="http://127.0.0.1/tut.php"; session_start(); header("Cache-control: private"); $_SESSION['userid'] = $username; header ("Location: $URL"); } else { echo("Login Incorrect. Please Try Again!"); } i want to do a check if the user has a session ie logged in this is the check on the second php page if (isset($_SESSION['userid'])) { }else{ echo "You aren't logged in."; $URL = "http://127.0.0.1/login.htm"; header ("Location: $URL"); exit(); } Please help many thanks Spooke2k Quote Link to comment https://forums.phpfreaks.com/topic/54727-solved-session/ Share on other sites More sharing options...
spooke2k Posted June 8, 2007 Author Share Posted June 8, 2007 missed session start i see on other bit Quote Link to comment https://forums.phpfreaks.com/topic/54727-solved-session/#findComment-270704 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.