Use Sticky Forms!
If a user inputs information that generates an error OR if he/she leaves a field blank, save them time (and increase your turnover) by using sticky forms. It's so simple and improves usability so much...
Let's say we're collecting first and last names (to keep it simple):
form.php <?php if (isset($_POST['submitted'])) { // Print the results. echo ' <h1>Your Name:</h1> First: ' . $_POST['first'] . ' Last: ' . $_POST['last'] . ' '; } else { // Invalid submitted values. echo ' <h1>Error!</h1> Please enter a valid name. '; } ?> <h2>Your Name</h2> <form action="form.php" method="post"> First: <input type="text" name="first" size="30" maxlength="40" value="<?php if (isset($_POST['first'])) echo $_POST['first']; ?>" /> Last: <input type="text" name="last" size="30" maxlength="40" value="<?php if (isset($_POST['last'])) echo $_POST['last']; ?>" /> <input type="submit" name="submit" value="Submit!" /> <input type="hidden" name="submitted" value="TRUE" /> </form>
So, if a user inputs a first name but no last name (or last but no first), it will show whatever the user has already typed (and preventing them from having to type it again)...if the form is lengthy, this is very handy and such a time saver.