Re: Saving Form Data
| From: | PHP | Date: | Wed, 08 Oct 2003 20:22:59 +0000 |
| Subject: | Re: Saving Form Data | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-165519@lists.php.net to get a copy of this message | ||
Unfortuanetly that would only work for Text and Textarea types.
It wouldn't really for for a select, bcause how do you know which option of
the form was selected?
How do you select the correct option without knowing what the other options
are?
Ex, a user uploads a form with a select type like so:
<select name="Month">
<option value="Jan">Jan</option>
<option value="Feb">Feb</option>
</select.
Your post value would be Month=Feb, if Feb was selected when the form was
filled out.
Now, I load the form again, I know that Month = Feb, but how to I now make
the form preselect the Option? I would somehow have to parse the form data
and look for the select of Month and then look through all the options for
Feb and insert a selected statement in the form in that spot.
----- Original Message -----
From: "Jay Blanchard" <jay.blanchard@niicommunications.com>
To: "PHP" <php_list@ibcnetwork.net>; "php"
<php-general@lists.php.net>
Sent: Wednesday, October 08, 2003 12:58 PM
Subject: RE: [PHP] Saving Form Data
> [snip]
> Is there anyway of saving a form with layout and data, without knowing
> what the fields are?
> I would like to be able to have the use "Upload" there own form. Then
> that form can be later viewed and filled out by someone else and be able
> to save all the data that was entered.
> I can do this easy enough with Text and Textarea type fields, but things
> like selects, radios, etc I can't think of a way to save them.
> Basically It would be like save a screen capture of the filled out form
> for viewing/altering later.
> [/snip]
>
> If the form method is POST all of the data is in the $_POST array which
> could be saved to a text file, if GET all of the data is in the $_GET
> array. You would have to read out of the saved text file to re-populate
> the form for editing or viewing later
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>