Re: [PHP] Pass $_GET to php cli.
On Tue, August 21, 2007 3:08 am, Per Jessen wrote: > N0K wrote: > >> But if it run in the browser, i think it have to run in cli, dont >> you >> think ? > > No, certainly not by default. They are very different environments, as > you have already found out. If you want to force it to work, you could hack up a CGI SAPI sort of thing... Or just toss it into a web-server somewhere and use wget from the command line to access it, which would be much easier. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pass $_GET to php cli.
N0K wrote: > But if it run in the browser, i think it have to run in cli, dont you > think ? No, certainly not by default. They are very different environments, as you have already found out. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pass $_GET to php cli.
> On 8/20/07, N0K <[EMAIL PROTECTED]> wrote: > [snip!] >> But if i do in a browser: >> http://www.example.com/administration.php?varpass=112233&checkpass=Submit >> >> Then i go directly to the administration web, without request pass. >> >> So, im trying to the the same in php command line > [snippity-snip!] > > One method: > > [filename=foo.php] > for($i=1;$i<$argc;$i++) { > $things = split("=",$argv[$i]); > $_GET[$things[0]] = $things[1]; > } > include('administration.php'); > ?> > > Then just call it like so (from a Unix-like command line --- > change this as appropriate for Windows, etc.): > > `which php` foo.php varpass=112233 checkpass=Submit > Hello, Thanks for your faster answer. I have to say im runing php cli from linux. And i havent got many idea about php, i only want to run from command line that script. I have test with Daniel Brown's script, but dont work. If you dont specific the password, then you get the html body when run the script and with your script, still getting the html body which request the password. I cant see the code because is encode with Zend, so, i cant give many details about it or modify it. But if it run in the browser, i think it have to run in cli, dont you think ? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pass $_GET to php cli.
On 8/20/07, N0K <[EMAIL PROTECTED]> wrote: [snip!] > But if i do in a browser: > http://www.example.com/administration.php?varpass=112233&checkpass=Submit > > Then i go directly to the administration web, without request pass. > > So, im trying to the the same in php command line [snippity-snip!] One method: [filename=foo.php] Then just call it like so (from a Unix-like command line --- change this as appropriate for Windows, etc.): `which php` foo.php varpass=112233 checkpass=Submit -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 Hey, PHP-General list 50% off for life on web hosting plans $10/mo. or more at http://www.pilotpig.net/. Use the coupon code phpgeneralaug07 Register domains for about $0.01 more than what it costs me at http://domains.pilotpig.net/. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Pass $_GET to php cli.
Hello. I trying something without results. I have a zend optimized php script. This script only request you a password, and then you go to admin page. If a do in a browser: http://www.example.com/administration.php Then i go to this web where the password is request. I put the password and go to the administration web. But if i do in a browser: http://www.example.com/administration.php?varpass=112233&checkpass=Submit Then i go directly to the administration web, without request pass. 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=112233&checkpass=Submit" php administration.php --"varpass=112233" --"checkpass=Submit And a lot of more combination. Can i do this by php command line ? Thanks and regards. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pass $_GET to php cli.
On Mon, 20 Aug 2007 14:15:47 +0200, N0K <[EMAIL PROTECTED]> wrote: > Hello. > > I trying something without results. > > I have a zend optimized php script. This script only request you a > password, and then you go to admin page. > If a do in a browser: > http://www.example.com/administration.php > > Then i go to this web where the password is request. I put the password > and go to the administration web. > > But if i do in a browser: > http://www.example.com/administration.php?varpass=112233&checkpass=Submit > > Then i go directly to the administration web, without request pass. > > 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=112233&checkpass=Submit" > php administration.php --"varpass=112233" --"checkpass=Submit > > And a lot of more combination. > > Can i do this by php command line ? > > Thanks and regards. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php You can use the 'argc' and 'argv' arrays for this. http://nl3.php.net/manual/en/features.commandline.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Pass $_GET to php cli.
Hello. I trying something without results. I have a zend optimized php script. This script only request you a password, and then you go to admin page. If a do in a browser: http://www.example.com/administration.php Then i go to this web where the password is request. I put the password and go to the administration web. But if i do in a browser: http://www.example.com/administration.php?varpass=112233&checkpass=Submit Then i go directly to the administration web, without request pass. 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=112233&checkpass=Submit" php administration.php --"varpass=112233" --"checkpass=Submit And a lot of more combination. Can i do this by php command line ? Thanks and regards. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php