[SOLVED] Stumped..
Posted: Thu Jan 01, 2004 3:15 pm
Code: Select all
<?PHP //linkadmin.php
$correct = "4985"; //change password here
$pass = $_SESSION['apass'];
ob_start();
echo "Session: ".$_SESSION['apass']."<br>";
echo "Variable: ".$pass."<br>";
echo "Correct value: ".$correct."<br>";
if($pass==$correct){
echo "<html>\n<body>\nLogged in!\n</body>\n</html>";
}
else {
if($_POST['pass']==$correct){
$_SESSION['apass'] = $correct;
header("Location:linkadmin.php?pass");
}
if(isset($_POST['pass']) && $_POST['pass']!=$correct) {
echo "Incorrect Password!<br>\n";
}
echo <<<EOT
<html>
<body>
<form action="linkadmin.php" method="post" name="passform">
Admin Password: <input type="text" name="pass"><br>
<input type="submit" name="submit" value="Log in">
</form>
</body>
</html>
EOT;
ob_flush();
}
?>http://www.404-design.net/linkadmin.php
some of the code is debug stuff, such as header("location:linkadmin.php?pass") isntead of linkadmin.php, is to see if that loop ran.
but even when it runs, and then redirects you, the session variable is empty..