RE: [PHP] Creating Dynamic Variables
| From: | Martin Towell | Date: | Thu, 18 Jul 2002 02:37:43 +0000 |
| Subject: | RE: [PHP] Creating Dynamic Variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-108200@lists.php.net to get a copy of this message | ||
I think you're more after this
session_start();
foreach ($HTTP_POST_VARS as $name=>$value) {
$$name=$value;
session_register($name); //with the $
}
HTH
Martin
-----Original Message-----
From: Anup [mailto:anup_patel@rogers.com]
Sent: Thursday, July 18, 2002 12:39 PM
To: php-general@lists.php.net
Subject: [PHP] Creating Dynamic Variables
Hello, I have captured variables from any HTML that is POSTed to me from a
'foreach' clause. Now, possibly in this foreach clause I want to register
these name/value pairs into a session var. I have tried :
session_start();
foreach ($HTTP_POST_VARS as $name=>$value) {
$name=$value;
session_register(name); //without the $
}
and get nothing.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php