RE: [PHP-INST] Help! No POST/GET variables!
| From: | David Rydell | Date: | Wed, 14 May 2003 16:26:16 +0000 |
| Subject: | RE: [PHP-INST] Help! No POST/GET variables! | ||
| References: | 1 | Groups: | php.install |
| Request: | Send a blank email to php-install+get-10894@lists.php.net to get a copy of this message | ||
a loop like the following will create $var1, $var2... from $_POST['var1'],
$_POST['var2']... etc
if ($_POST) {
reset ($_POST);
while (list ($key, $value) = each ($_POST)) { ${$key} = $value; }
}
same applies to $_GET, $_SERVER, $_COOKIE, $_ENV...
-----Original Message-----
From: Jeremy Mereness [mailto:jeremym@optonline.net]
Sent: Wednesday, May 14, 2003 12:02 PM
To: php-install@lists.php.net
Subject: Re: [PHP-INST] Help! No POST/GET variables!
You know, I had read about this somewhere as a new "feature" of PHP, but
didn't make the connection.
Thanks very much for the quick answer. It turns out my Linux distro packages
PHP with global variables switched on by default, while getting PHP from the
source will have them switched off. Up til now I'd never thought about it.
I guess the idea is to write "cleaner" code making use of $_POST[variable]
and $_GET[variable] structures? or is there a better method?
-- j
----- Original Message -----
From: "Daniel Moore" <danielm@gropep.com.au>
To: <jeremym@optonline.net>
Cc: <php-install@lists.php.net>
Sent: Wednesday, May 14, 2003 9:09 AM
Subject: Re: [PHP-INST] Help! No POST/GET variables!
> Is it a global variables thing?
--
PHP Install Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.473 / Virus Database: 271 - Release Date: 4/17/2003
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.473 / Virus Database: 271 - Release Date: 4/17/2003