if register_globals setting is on (in php.ini) then $foo will be 
available, otherwise use the predefined variable HTTP_GET_VARS :

  index.php?foo=blah

  print $foo;
  print $HTTP_GET_VARS['foo'];

  
  http://www.php.net/manual/en/language.variables.predefined.php
  http://www.php.net/manual/en/configuration.php#ini.register-globals

btw, you'll note predefined variable QUERY_STRING exists in there too :-)

regards,
philip


On Sat, 28 Apr 2001, Jamie Saunders wrote:

> Hi,
> 
> How do you grab variables from a query string in a URL?
> I've used this with ASP and it would be done as follows:
> 
> firstName = request.querystring("fName")
> 
> I've tried different variations of this in my PHP pages but I can't seem to 
> get it to work.  I've looked in the PHP manual but can't find any 
> information relating to the query string.
> 
> Thanks.
> 
> Jamie Saunders
> Mail: [EMAIL PROTECTED]
> Web: http://jamie-s.co.uk
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to