Hi, i have little problem, i found simple login system and using to login existing database, but all passowrds hashed i think is sha256, and user can only login with hash, not he’s password.
Here is example
[CODE] $SHA$c325d138e7a5b67d$3d8740300cc0292a513f750b0d872a71b16c9430cc3ff9d8ca8d29c8d081eb04
maybe somone can help me, and user can login with he’s normal password.
[B]Here is login.php:
[code=php]<html>
<head>
<title>User Login Form – PHP MySQL Login System</title>
</head>
<body>
<h1>User Login Form – PHP MySQL Login System/h1>
<?php
if (!isset($_POST[‘submit’])){
?>
<!– The HTML login form –>
<form action=”<?=$_SERVER[‘PHP_SELF’]?>” method=”post”>
Username: <input type=”text” name=”username” /><br />
Password: <input type=”password” name=”password” /><br />
<input type=”submit” name=”submit” value=”Login” />
</form>
<?php
} else {
require_once(“db_const.php”);
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
# check connection
if ($mysqli->connect_errno) {
echo “<p>MySQL error no {$mysqli->connect_errno} : {$mysqli->connect_error}</p>”;
exit();
}
$username = $_POST[‘username’];
$password = $_POST[‘password’];
$sql = “SELECT * from authme WHERE username LIKE ‘{$username}’ AND password LIKE ‘{$password}’ LIMIT 1”;
$result = $mysqli->query($sql);
if (!$result->num_rows == 1) {
echo “<p>Invalid username/password combination</p>”;
} else {
echo “<p>Logged in successfully</p>”;
// do stuffs
}
}
?>
</body>
</html>
[B]Thank you ?