Re: Pass $_GET to php cli.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/20/07, N0K <n0k@xxxxxxxxxx> 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

-- 
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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux