check form - save arrays in hidden fields?
| From: | Fabian Krumbholz - 2k web solutions | Date: | Tue, 26 Mar 2002 09:30:42 +0000 |
| Subject: | check form - save arrays in hidden fields? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-90160@lists.php.net to get a copy of this message | ||
I have a contact form (form.php). I check the submitted data with the
same php file.
If the e-mail adress is not valid I ask the user for a valid e-mail adress.
Therefor I create a new form with the field e-mail. The valid date name,
adress, ...
I put into hidden fields, so they don't get lost.
This works fine until I integreate a file upload into my form.
The file data stored in the $_FILES array get lost, when I submit the
form the second time (when the e-mail adress isn't valid).
The same problem occours when I integrate a list box where it is possible to
choose more then one item:
<select name="test[]" size="3" multiple>
<option value="test1"> test1</option>
<option value="test2"> test2</option>
<option value="test3"> test3</option>
</select>
Is there an easy way (in PHP 4.1.2) to store arrays like scalar variables in
hidden fields, without using a database or transforming the array data
into a string?
Thanks,
Fabian Krumbholz
www.2k-web.de