values in forms
| From: | bryan brown | Date: | Thu, 28 Sep 2000 16:07:26 +0000 |
| Subject: | values in forms | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-17922@lists.php.net to get a copy of this message | ||
I have a page with several input forms. If the fields
are not set or are set incorrectly, a similar (but
different) page will open with the same fields, but
displaying an error message and an asterisk next to
the first incorrect field. Is there a way I can keep
all the values the way the user entered them before
going to the error page? I tried making an array and
when it checks the fields, it stores all the values in
the array. And the error page prints the values in
the fields, but it doesnt work. Its looks like this:
<!-- processesform.php3 -->
...
include('variables.php3');
// $oldfields is in variables.php3
$oldfields[0] = $f_name;
$oldfields[1] = $l_name;
$oldfields[2] = $email;
$oldfields[3] = $organization;
$oldfields[4] = $street;
$oldfields[5] = $city;
$oldfields[6] = $state;
$oldfields[7] = $zip;
$oldfields[8] = $country;
$oldfields[9] = $h_phone;
$oldfields[10] = $b_phone;
// Check if all fields are in correct form.
// If they are not, go to errorform.php3
...
<!-- errorform.php3 -->
...
include('variables.php3');
...
echo "<td><input type=\"text\" value=$oldfields[$i]
name='$value'></td></tr>\n";
$i is set, but the fields still remain empty.
Any help????
__________________________________________________
Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
http://photos.yahoo.com/