Re: newbie question regarding URL parameters
| From: | tg-php at gryffyndevelopment dot com | Date: | Sat, 06 Jan 2007 02:17:48 +0000 |
| Subject: | Re: newbie question regarding URL parameters | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-246668@lists.php.net to get a copy of this message | ||
You'll probably get 50 answers to this, but here's probably what happened.
There's a setting called "register globals" that will turn your name=me and age=27
into $name = "me" and $age = "27". It used to be turned ON by default. This
was generally considered to be bad security, so it now defaults to OFF.
To get these variables, just use the $_GET system variable.
$name = $_GET['name'];
$age = $_GET['age'];
Easy!
Best of luck!
-TG
= = = Original message = = =
Hello,
I have a newbie question regarding URL parameters. The PHP script I
wrote need to read parameters passed in from a URL, so as an example
http://my.domain/myscript.php?name=me&age=27
and my script would use $name to get the value for name and $age to
get the value for age.
Everything was working fine until the sysadmin did a upgrade of the
PHP server, and $name and $age both give me nothing.
I am just wondering if the latest version of PHP has changed the way
to access url parameters. If so, what would be the correct way of
doing it? Please help. Thanks.
- Jim
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.