Link to home
Start Free TrialLog in
Avatar of ticallian
ticallian

asked on

PHP:

How can i create an array containing all field names and values from a posted form.      
I then need to save the array as a session for later use.

The code i have works for storing the field input names, just not their submitted values.

Thanks for any help
$fields = array();
foreach ($_POST as $field => $value){
	array_push($fields, $field); 
} 
$_SESSION['fields'] = $fields;

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of mostart
mostart

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ticallian
ticallian

ASKER

Perfect!
Thanks