Re: Array of setted vars by PHP
| From: | Stig Sæther Bakken | Date: | Tue, 13 Apr 1999 09:25:49 +0000 |
| Subject: | Re: Array of setted vars by PHP | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-5027@lists.php.net to get a copy of this message | ||
Bram Heerink wrote:
>
> Hey,
>
> I'm building kindoff weird script. But I don't know
> the names of the field elements that are posting to
> the PHP Script.
>
> It would be very handy to have an array of variables that
> are SETTED by PHP.
>
> For example:
>
> <input type="text" name="name">
> <input type="text" name="address">
> ...
>
> Submit Script, there's an array ... for example $PHP_Vars
>
> $PHP_Vars[0] = "name" => $name
> $PHP_Vars[1] = "address" => $address
>
> It's neat that the variables ARE set... but in this
> case I don't know their names...
There are three arrays in PHP: $HTTP_GET_VARS, $HTTP_POST_VARS and
$HTTP_COOKIE_VARS that probably are what you want. In order to have
them set, you must be running PHP with the "track_vars" php3.ini option
on, or with <?php_track_vars?> in the beginning of your script.
For a GET request you'll get a list like this:
reset($HTTP_GET_VARS);
while (list($name, $value) = each($HTTP_GET_VARS)) {
print "$name = $value<br>\n";
}
In the future, please use php3@lists.php.net for questions like this.
- Stig
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net