Re: Newbie : How work with parameters?

From: Date: Wed, 27 Nov 2002 09:55:43 +0000
Subject: Re: Newbie : How work with parameters?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-126253@lists.php.net to get a copy of this message
At 09:58 27.11.2002, Stéphane Génin said: --------------------[snip]-------------------- >I want to read the parameters in the URL, but I can't find the right way to >do that. I've tried several things : > >my URL is: http://localhost/test.php?id=abc Check out the PHP manual at http://www.php.net/manual/en/reserved.variables.php#reserved.variables.get >I tried to use the $id, but in this case, I have a notice with 'undefined >variable'. >I have the same problem if I try the variable $QUERY_STRING (still undefined >variable). > >Do you know what is the best way to read this parameters? Most certainly, register_globals is OFF in your php.ini. This is the default setting since PHP 4.2, for security reasons. Read http://www.php.net/manual/en/security.registerglobals.php on the security issues with register_globals = on. To access parameters, generally use the superglobals arrays $_GET (parameters passed in the URL), $_POST (passed in posted forms), $_REQUEST (both get and post combined), and $_COOKIE (cookies passed to your script). Hope this gets you started. You may always find it helpful to refer to the _extremely_ well done online manual at http://www.php.net/manual/en/. Regards, -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/

« previous php.general (#126253) next »