Passing a Variable to PHP Via the URL
| From: | jsegovia at mindspring dot com | Date: | Tue, 11 Jun 2002 15:53:32 +0000 |
| Subject: | Passing a Variable to PHP Via the URL | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-101562@lists.php.net to get a copy of this message | ||
My understanding is that when passing a querystring to PHP via the URL with the GET method, PHP will
automatically create a variable with the name and value from the querystring. I'm trying to do
this and it's not working.
Here's my code from an online tutorial (angle braces replaced with curlies):
printf("{a href=\"%s?id=%s\"}%s %s{/a}{br}\n", $PHP_SELF,
$myrow["id"], $myrow["first"], $myrow["last"]);
Everything here works - I've already loaded the $myrow with the appropriate data and so this
printf builds a URL with a valid '?id=' querystring.
But when I click on the URL, the variable is not created. I've tried renaming the variable,
querying $HTTP_GET_VARS to see what's coming in, and looking at all available online
documentation, but nothing helpful. There doesn't seem to be anything in php.ini I need to set
to enable this functionality.
Can anyone help? Thanks very much in advance.
Jesse