note 45257 added to reserved.variables
| From: | DaveZyga at osu1 dot php dot net | Date: | Tue, 31 Aug 2004 13:48:24 +0000 |
| Subject: | note 45257 added to reserved.variables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-75739@lists.php.net to get a copy of this message | ||
An easy way to gather all $_POST variables for form processing:
$post = array();
$post = $_POST;
foreach($post as $key => $value)
$$key = $value;
This assigns all variables from the form the values they pass.
For example, if a form contains
<input type='text' name='fname'>
<input type='text' name='lname'>
The submit page will have variables $fname and $lname, each containing the values the user entered
in these two textboxes.
Just a nice shortcut when processing large forms.
----
Manual Page -- http://www.php.net/manual/en/reserved.variables.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+45257
Delete -- http://master.php.net/manage/user-notes.php?action=delete+45257&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+45257&report=yes
Search -- http://master.php.net/manage/user-notes.php