i have encrypted admin passwords in mysql, now i want to make the login page work. but my code seems to be failing to login. please help:
here is my .php file to connect and make validation:
here is my .php file to connect and make validation:
Code:
mysql_connect($host,$user,$pass);
mysql_select_db($db);
if (isset($_POST['admin']) || ($_POST['password'])) {
$password = $_POST['password'];
$sql = "SELECT * FROM admin WHERE password = SHA1('$password')";
$result = mysql_query($sql);
if (mysql_num_rows($result)==1)
{
header("Location: admin.php");
} else {
echo "<h1>Invalid Login Information</h1>";
}
}
?>
Comment