o, now i really dont know wat to do, im trying to do a forgotten password form, so the user enters their user name and it returns a secret question that they filled in and answered at registration, it then displays a secret question, they enter their answer, and then it takes them to the desired page, this is the code i have, but i dont know where to put the redirecting stuff now,
<html>
<head><title> wank</title></head>
<body>
<form name="form1" method="post" action="results.php">
<input name="username" type="text" id="username">
<input type="submit" name="Submit" value="Submit">
</form>
<?php
$conn = mysql_connect('localhost','root','') or die("Could not connect to mysql");
$rs = @mysql_select_db('login',$conn) or die("Could not connect to mysql");
$username = $HTTP_POST_VARS['username'];
$sql = "SELECT passwordr, passworda FROM users WHERE username ='" . $username . "'";
$rs = mysql_query($sql,$conn);
while ($row = mysql_fetch_array($rs) )
{
echo ($row["passwordr"]);
if ($row["passwordr"]!=null)
{
$success = true;
$getpassworda = $row["passworda"];
?>
<form name="form2" method="post" action="results.php">
<input name="password" type="text" id="password">
<input type="submit" name="Submit" value="Submit">
</form>
<?php
}
$password = $HTTP_POST_VARS['password'];
if ($password == $getpassworda){
mysql_close($conn);
}
}
?>
</body>
</html>