[PHP] Re: Pass $_GET to php cli.

2007-08-20 Thread Per Jessen
N0K wrote:

 So, im trying to the the same in php command line
 
 i have test with many things, but i dont know how to specify this
 variable to the php cli,
 some tested example:
 
 php administration.php --varpass=112233 --checkpass=Submit
 php administration.php --varpass=112233checkpass=Submit
 php administration.php --varpass=112233 --checkpass=Submit
 
 And a lot of more combination.
 Can i do this by php command line ?

Yes, but not that way.  There is no automagic mapping of argv[]
variables to $_GET.  Take a look at the 'getopt' function. 


/Per Jessen, Zürich

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



Re: [PHP] Re: Pass $_GET to php cli.

2007-08-20 Thread Thijs Lensselink
On Mon, 20 Aug 2007 14:41:03 +0200, Per Jessen [EMAIL PROTECTED] wrote:
 N0K wrote:
 
 So, im trying to the the same in php command line
=20
 i have test with many things, but i dont know how to specify this
 variable to the php cli,
 some tested example:
=20
 php administration.php --varpass=3D112233 --checkpass=3DSubmit
 php administration.php --varpass=3D112233checkpass=3DSubmit
 php administration.php --varpass=3D112233 --checkpass=3DSubmit
=20
 And a lot of more combination.
 Can i do this by php command line ?
 
 Yes, but not that way.  There is no automagic mapping of argv[]
 variables to $_GET.  Take a look at the 'getopt' function.=20
 
 
 /Per Jessen, Z=C3=BCrich
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

I don't see where N0K asks for mapping of $_GET to commandline parameters.

getopt is a good solution. But not very portable (it only works on *nix systems)
And with list() and the argv array you can get the same effect.

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



Re: [PHP] Re: Pass $_GET to php cli.

2007-08-20 Thread Per Jessen
Thijs Lensselink wrote:

 I don't see where N0K asks for mapping of $_GET to commandline
 parameters.

He did't specifically ask, but his attempts seem to suggest that's what
he was hoping for. 


/Per Jessen, Zürich

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