Hey ladies and gentlemen, I need some help with my forgotten password script. It gives me an error on line 10.
<?php
include('./inc/config.php');
$_email = $_POST['email'];
if($_email == '');
{
header('Location: email-password.php?send=Please provide an email address');
}
else
{
if(email_verified($_email))
{
$to = $_email;
$subject = "Forgotten your password?";
$header = 'From: example@example.com';
'Reply to: example@example.com';
'X-Mailer: PHP/' .phpversion();
$mysqli->query("SELECT username, password FROM users WHERE username = '$username' AND password = '$password'");
$messages.= 'Forgot password - $hotelname';
$messages.= '____________________________';
$messages.= 'Your Login information';
$messages.= 'Username: $username \r\n';
$messages.= 'Password: $password\r\n';
$messages.= '____________________________';
$sendmail = mail($to, $subject, $messages, $header);
if($sendmail)
{
header("Location: email-password.php?send=Password was successfully emailed to you");
}
else
{
header("Location: email-password.php?send=Sorry, we couldn't email you the password");
}
}
else
{
header("Location: email-password.php?send=email address not found");
}
}
function email_verified($email)
{
$rx = "^[a-z0-9\\_\\.\\-]+\\@[a-z0-9\\-]+\\.[a-z0-9\\_\\.\\-]+\\.?[a-z]{1,4}$";
return (preg_match("~".$rx."~i", $email);
}
?>
Line 10 is the first else statement and I just can't find it since it's 9:35 and I have school tomorrow so hopefully I'll get a respond by tomorrow good night.