Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting all of a form's variables 1

Status
Not open for further replies.

jimoblak

Instructor
Oct 23, 2001
3,620
US
I am creating a form (on page 'A') that will submit it's contents to another page (page 'B').

Is there any way to have page 'B' list all of the form field names and values that were submitted from page 'A' without actually naming the variables in the PHP code of page 'B'? I would like to make page 'B' a test page to obtain all submitted data from another form page. If I add more fields to page 'A', they will automatically appear in the output of page 'B'. No error checking is needed on page 'B'. I'm just looking to spit out raw form data.
 
Here's a follow-up question:

The print_r function produces something like this:

Array ( [Name] => John Doe [Address] => 123 Maple Lane [City] => Springfield [State] => MO [Zip] => 90210 )

Is there any way to process this array? I would like to take the array of $_POST and save it into a single field of a MySQL table. (The variable names from the submitting form are always changing so I cannot define static fields in the MySQL table. I need to dump everything in one big old text field and deal with it later.)

Then (later) I need to pull the array back out of the MySQL table and split it up into it's different values.

Is this possible? Howis it done?
 
You can also store session data on MySQL. I've published a FAQ in this forum which shows you how to do it. faq434-2037


One gotcha with serialize() and unserialize(): it sometimes get confused by apostrophes in text and cannot unserialize the data correctly. This bug exists in PHP 4.2.3 ______________________________________________________________________
TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top