Hello, sorry I have not helped you much lately...
Been busy, although to your question; the part of your script which registers the actual error message, ie
PHP Code:
$errorArray[] = 'Please enter your email address';
.
.
Maybe instead of relying on incremental indexing, why not use assocc ?
PHP Code:
.
.
# checking email FROM INPUT from user at this point...
$errorArray['Email'] = 'Please enter your email address';
.
.
# rest of script
Now then, to check if you need to put the email address back to the FORM; ie the email address is valid, then you simply check for this array index being null or empty ?
If so, then take the $_POST[...] sent by the user via form submission and place this back into the FORM ?
PHP Code:
# part of script to re-display FORM due to finding bad inputs from user
.
.
$flag = false;
#msg = '';
if(empty($errorArray['Email'])) {
# email address was okay so keep it
$msg = $_POST['email'];
}
# now create the INPUT box again
<input type='text' name='email' value='<?php echo($msg); ?>' size='16' maxlength='48'>
.
.
# check for next INPUT box etc
That'd work for you ?
Bookmarks