|
-
Feb 2nd, 2003, 07:54 PM
#1
Thread Starter
Member
form data to array?
suppose i have a form, then the fields are generated dynamically (because each user can generate any number of fields in a new table and i read the fields from that table and put it in the form)
So, how do i put that form data into an array, because the field names are done by the user and i won't have any idea what they are.
thanks!
-
Feb 3rd, 2003, 11:32 AM
#2
Frenzied Member
you have the names of the form elements don't ya? well then that is all you need to put the values in the array. when they submit the form just tke those names and insert the values form the form into the array and then you can do what youwant with them.
-
Feb 3rd, 2003, 12:14 PM
#3
Stuck in the 80s
Re: form data to array?
Originally posted by Zhiquan
suppose i have a form, then the fields are generated dynamically (because each user can generate any number of fields in a new table and i read the fields from that table and put it in the form)
So, how do i put that form data into an array, because the field names are done by the user and i won't have any idea what they are.
thanks!
Give this a try. It'll cycle through each $_POST variable and give you the name and value:
Code:
while (list($var, $value) = each ($_POST)) {
echo "$var = $value<br>\n";
}
If your have pre PHP 4.1.0, use $HTTP_POST_VARS instead of $_POST.
Hope this helps.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|