Creating local vars from HTTP Post Array
| From: | Javier . | Date: | Fri, 17 Oct 2003 10:11:57 +0000 |
| Subject: | Creating local vars from HTTP Post Array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-166434@lists.php.net to get a copy of this message | ||
I'm re-coding a fairly large multi step form which was written with PHP's register globals turned on. Since upgrading PHP this form has stopped working and needs editting.
Rather than manually changing each var -
$foo to $_POST['foo'](there are simply too many) i'd like to do something like this - while(list($key, $val) = each($_POST)) eval("\$.$key = stripslashes($value)"); using a loop to create local variables for each variable in the HTTP Post array. I'm having trouble getting this to work. Anyone help? Cheers, Javier _________________________________________________________________ It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger