I have following code on my login.php file :
<?php
session_start();
$error = '';
if (isset($_POST['submit'])) {
if (empty($_POST['username']) || empty($_POST['password'])) {
$error = "complete fields!";
} else {
$username = $_POST['username'];
$password = $_POST['password'];
$connection = mysql_connect("localhost", "root", "");
$db = mysql_select_db("simozar", $connection);
$query = mysql_query("select * from admin where password='$password' AND username='$username'", $connection);
$rows = mysql_num_rows($query);
if ($rows == 1) {
$_SESSION['login_user'] = $username;
header("location: admin/index.php");
} else {
$error = "wrong user or pass.";
}
mysql_close($connection);
}
}
?>
I haven't any signup page and this is admin login page and i set user and password manually in database.
I tried hash password in edit option in php my admin database table and my password is 'aminhd' and hashed by phpmyadmin password hash to '*CCF10A8709AE3EF3D868CA4581B33BAF44D1AD1F' (that picture on buttom).
How can in login with this password (aminhd) to page?
This img : https://i.stack.imgur.com/iz4xN.png