Hey there.
I’ve created an “email my password” script for my site that can be emailed to a user via a simple form. It works fine, with either a “success” or “please try again” phrase that appears depending upon whether a match in the database is made. The problem I have is when NO text is entered into the text field (text field box = userEmail.) When a user then hits submit – the “success” phrase is shown, rather than “please try again”. Here’s my script… hope someone can help:
<?php
//Show If Conditional
if (@$row_retrievePassword[‘user_email’] == $_POST[‘userEmail’]) {
$to = $
$from = “From: [email][email protected]
$subject = “Your Password Request”;
etc etc
$_POST[‘userEmail’];
?>
Success! Your password has been sent.
<?php
//Show If Not Conditional
} elseif (@$row_retrievePassword[‘user_email’] != $_POST[‘userEmail’]) {
?>
This address could not be found. Please try again.
<?php
} // End
?>