blesseld Posted April 19, 2010 Share Posted April 19, 2010 Hey All, I am trying to figure out how I can eliminate having to log in 2 times. There is no database. it just sets a session, but because the browser doesn't refresh you have to login 2 times. Looking for some sort of "check" solution... any suggestions? if (isset($_POST['username'])) { $username = $_POST['username']; $password = $_POST['password']; if ($username == "" || $password == "") { $error = "<div id=\"login-warning-box\"><center><p class=\"login-text\">Not all fields were entered.</p></center></div>"; } else { if ($username != "$set_username" || $password != "$set_password") { $error = "<div id=\"login-warning-box\"><p class=\"login-text\">Username/Password invalid.</p></div>"; } else { $_SESSION['username'] = $username; $_SESSION['password'] = $password; $admin_panel = "$admin_panel_url"; header ("Location: $admin_panel");//CHANGE DOMAIN die(""); } } } header.php ob_start(); session_start(); if (isset($_SESSION['username'])) { $username = $_SESSION['username']; $loggedin = true; } else $loggedin = false; thanks, Quote Link to comment Share on other sites More sharing options...
Jax2 Posted April 19, 2010 Share Posted April 19, 2010 try a meta refresh ... should work ... 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.