Re: newbie question regarding URL parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux