session_start();
include('db.php'); //Connect to database
//Check Dunn user
if(isset($_POST['submit1'])) {
$stmt = $link->prepare("SELECT * FROM accreg WHERE mail = ?");
$stmt->execute([$_POST['mail']]);
$data = $stmt->fetch();
if (password_verify($_POST['password'], $data['password'])){
//assign the cookie
$_SESSION['user_id'] = $data['user_id'];
$_SESSION['mail'] = $data['mail'];
setcookie('mail', $data['mail'], time()+60*60*24*30);
header ('Location: acc.php');
}
else {
echo "Data is incorrect";
}
}
to make this record was just me
<input type="hidden" name="myID" value="ID here">
Find more questions by tags PHP
And how else if not? - fleta87 commented on June 10th 19 at 16:44
In General that's something like this if no PDO:
Will not appear in the database - print the echo $query; See what shove.
If rules - copy and in phpMyAdmin -> SQL execute.
You can not simply find a place with the error chtoli?)) - Leda15 commented on June 10th 19 at 16:47
So I did, but it is not a request
- fleta87 commented on June 10th 19 at 16:50
All I no longer know how to explain))) - Leda15 commented on June 10th 19 at 16:53