RE: [PHP] php commandline
| From: | Sean Mathews | Date: | Thu, 06 Jul 2000 03:13:57 +0000 |
| Subject: | RE: [PHP] php commandline | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-4941@lists.php.net to get a copy of this message | ||
How about this (assuming the script runs on linux).
---code begins
#!/usr/local/bin/php -q
<?PHP
echo($argv[0]."\n" . $argv[1] . "\n");
?>
---code ends
etc etc etc
-----Original Message-----
From: Daniel Gustafsson [mailto:cloaked@hem.passagen.se]
Sent: Wednesday, July 05, 2000 9:03 AM
To: php-general@lists.php.net
Subject: Re: [PHP] php commandline
At 04:01 PM 7/5/00 +0200, you wrote:
>hi!
>
>how can i pass arguments to a php scripts called from the command line?
>(for example in an autoresponder mail alias)
You'll have to set the enviroment variable QUERY_STRING (it's how the web
server passes everything after the '?' to a standard cgi). Remember that it
has to be formatted in the same manner.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net