Say a user of mine has entered their email into a reset password form, they get sent a email with a link that will bring them to the page above with special codes in their link
For example -
http://mylink.com/resetpassword.php?email=blabla@gmail.com&code=2384753
When I try to use $_GET['email']
to get the email from the link and check it with a query it doesn't work
Here is part of my code:
$email = $_GET['email'];
$check = mysqli_query($conn, "SELECT * FROM users WHERE email='$email' ");
if(mysqli_num_rows($check) == 1){
mysqli_query($conn, "UPDATE users SET password='$password' ");
}else{
echo "failed 2";
}
But I get the failed 2
error. and I'm pretty sure it's because when I click submit all of the extras in the link go away and its just resetpassword.php
When I turn on error reporting the following appears -
Notice: Undefined index: email in /var/www/resetpass.php on line 6
Does anyone know what the problem could be?