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:
If there is no data the browser wont send the field and therefore it will never be set unless something is in it
Not sure if you've tested that but the servers I work with will detect all fields within the POSTed form as being set, even if they are blank. This may be browser dependant, but as you can't gaurauntee what your site will be viewed with I would recommend checking for both eventualities.
if (isset($_POST['field']) && $_POST['field'] != '')
Last edited by Brooksie155; 03-15-2006 at 03:29 AM.