AV1611 Posted April 18, 2007 Share Posted April 18, 2007 Anyone tell me why the header doesn't work on this? I am not getting any errors, just a blank page Here is the relevant parts of the form: //clause: If not logged in:{ <form name="login" METHOD="POST" action="mastersecurity.php"> Login: <input type="text" SIZE="8" name="Loginname"> Password: <input type="password" SIZE="8" name="Loginpass"> <input type="submit" name="Submit" value="Login"></form> // else: { <form name="logout" METHOD="POST" action="mastersecurity.php"> <input type="hidden" name="logout" value="logout"> <center><input type="submit" name="logout" value="logout"></center> </form> And here is the processor script <?PHP if(isset($_POST['logout']) && $_POST['logout']=='logout') { session_start(); session_destroy(); header('./teknetix.php'); } else { include('sql.inc.php'); $pass=$_POST['Loginpass']; $password = sha1($pass); $UserID=$_POST['Loginname']; $result = mysql_query("SELECT * FROM users WHERE userid = '$UserID' AND password = '$password'"); IF ($row=mysql_fetch_array($result)) { session_start(); $_SESSION['AUTHUSER'] = 'YES'; $_SESSION['UserID'] = $_POST['Loginname']; $_SESSION['pass'] = $_POST['Loginpass']; header('./teknetix.php'); } ELSE { echo "<center><br/><font size='4'>Invalid Login<br/><br/><a href='teknetix.php>Return To Main Page</a></center>"; } } ?> I am trying to destroy the session if they logout and create the session with their login info in they login (credentials are used on subsequent pages...) Link to comment https://forums.phpfreaks.com/topic/47637-solved-header-not-working/ Share on other sites More sharing options...
AV1611 Posted April 18, 2007 Author Share Posted April 18, 2007 It's header('Location: ./file.php') I had header('./file.php') Link to comment https://forums.phpfreaks.com/topic/47637-solved-header-not-working/#findComment-232654 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.