Ok, either you show the form again or you continue and the form was submitted successfully. I think what I wasn't understanding is when the error messages get displayed when the fields aren't filled out properly? I've got the error messages stored in the $message variables. If no messages the form is submitted and you get the successs message otherwise the form is re-displayed. So would the error message appear at the top of the page and then the form underneath?
When I started I tried to put the form before the if statments checking for values. It just seeme like I was trying to check for something that didn't exist yet.
The way it is now. When in error the form is redisplayed but without filling in the fields with the previous values. How do you retain the values from the previous form to fill the values back in on the new form?
I tried it like this:
PHP Code:
$firstName = mysql_real_escape_string($_POST['firstName']);
to store the field information.
and then when the form re-displays I tried to display values:
PHP Code:
<label for="firstName">First name:<span>*</span></label>
<input type="text" id="firstName" value="<?PHP echo $firstName; ?>" name="firstName" tabindex="1" />
I tried to combine the auth.php where the session was started the form.php and combine the two files into one. I've also added the captcha. It works perfectly, the way you showed me but I'm kind of lost with the error messages. If there is an error we just display the form again but the user doesn't know what they did wrong.
When you get to the statement:
This is where I should have the my error statement and then put everything in a brackets, maybe starting like this:
PHP Code:
<?PHP
if($showform) {
echo $message
?>
<html>
<head>
</head>
<body>
<h1>Form Project</h1>
<p><span>*</span>Indicates required information</p>
<form name='information' action ='form.php' method='POST'>
<fieldset id='address'>
<legend>Contact</legend>
<ul class="form">
<li>
<label for="firstName">First name:<span>*</span></label>
<input type="text" id="firstName" value="<?PHP echo $firstName; ?>" name="firstName" tabindex="1" />
</li>
...................
...................
I'm sure your thoroughly confused about what I just posted?