Forum Moderators: coopster
I would imagine there is a very easy answer to this but at the moment i cant see it. Below is part of my code that i am having trouble with. It basically does not re-direct the user to the main.php page. If i replace the
header("Location: main.php");
with
echo "Welcome to Secure Area.";
It shows the Welcome to Secure Area.
*************************CODE**********************
if($submit)
{
$user = $_POST['user'];
$pass = $_POST['pass'];
if($user == "$data[admin_user]" && md5($pass) == "$data[admin_pass]")
{
header("Location: main.php");
}
else
$check=1;
}
?>
<form action="<?php echo $PHP_SELF?>" method="post">
Username:<br />
<input type="text" name="user" size="20"><br /><br />
Password:<br />
<input type="password" name="pass"><br /><br />
<input type="submit" name="submit" value="Log in">
</form>
<?php
if($check == 1)
echo 'There has been an error logging you in, please try again. If this problem persists please contact your <a href="****" title="">administrator</a>.';
?>
THanks in advance
"Note: HTTP/1.1 requires an absolute URI as argument to Location: including the scheme, hostname and absolute path, but some clients accept relative URIs. You can usually use $_SERVER['HTTP_HOST'], $_SERVER['PHP_SELF'] and dirname() to make an absolute URI from a relative one yourself:
I hope it helps!
IamStang