Jump to content

[SOLVED] Header not working...


AV1611

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.