Page 1 of 1

Unifined index 'argv' in $_SERVER['argv']

Posted: Thu Jul 06, 2006 3:27 pm
by kendall
Hi,

i have noted a $_SERVER parameter called 'argv' which suppose to contian an array of paramters passed via the url

No on trying to access this parameter by passing a querystring url on my local installation of php i get the error
otice: Undefined index: argv in ......
is there some option i need to turn on in my PHP config to have access to th is variable?

Kendall

Posted: Thu Jul 06, 2006 3:31 pm
by RobertGonzalez
Is 'argv' a server variable?

Posted: Thu Jul 06, 2006 3:37 pm
by kendall
Everah wrote:Is 'argv' a server variable?
http://www.php.net/manual/en/reserved.variables.php

well...they say it may/ may not be available....i was hoping i knew how to get it :? :?:

anyone ever used this?

Kendall

Posted: Thu Jul 06, 2006 3:50 pm
by Robert Plank
I think argv is for arguments from the command-line when you call PHP directly through the CLI... if you just want "parameters passed via the url" why aren't you using $_GET?

Posted: Thu Jul 06, 2006 4:45 pm
by RobertGonzalez
Reading the CGI 1.1 Specification, there is no mention of the argv variable. When reading the PHP definition of the 'argv' variable, this stands out...
The PHP Manual on Predefined Variables wrote:Array of arguments passed to the script. When the script is run on the command line, this gives C-style access to the command line parameters. When called via the GET method, this will contain the query string.

Posted: Thu Jul 06, 2006 5:37 pm
by Robert Plank
I used to sometimes use argv a long while ago but it broke for me around late 2004 / early 2005.