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

Re: [cobalt-users] PHP from Command Line



On Wed, 25 Sep 2002, Daren Cotter wrote:

> Gerald,
>
> Thanks, but this does NOT work...
>
> <?
> print "Arg Count: " . $argc . "\n";
> print $argv[0] . " " . $argv[1];
> ?>
>
> php -c /etc/httpd/php.ini -f test.php blah blah
>

[root web]# vi test2.php
[root web]# php -c /etc/httpd/php.ini test2.php blah blah
X-Powered-By: PHP/4.1.2
Content-type: text/html

Arg Count: 3
test2.php blah

Isn't that what we should get?
Args 0, 1 and 2 is 3
Argv[0] will be the command and argv[1] is "blah"

<?
print "Arg Count: " . $argc . "\n";
print $argv[0] . " " . $argv[1]  . " " . $argv[2];
?>
[root web]# php -c /etc/httpd/php.ini -f test2.php blah blah
Arg Count: 3
test2.php blah blah


Gerald
--
http://frontstreetnetworks.com | http://raqware.com
Front Street Networks LLC  | Phone: +1 203-785-0699
229 Front Street, Ste. C, New Haven, CT. 06513-3203