Re: php.exe from command line
| From: | Evan | Date: | Mon, 29 Jul 2002 17:59:02 +0000 |
| Subject: | Re: php.exe from command line | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-110220@lists.php.net to get a copy of this message | ||
I didn't thought about this, but it's logic (as always).
However I solved my problem:
I've developed a really simple program with C++Builder6 (only ~15 lines of
code :-P) that every X seconds calls the php file (agent.php).
And finally it works!!!!!
Thanks for your help,
Evan
<cteubner@ncw-av.com> ha scritto nel messaggio
news:1828995E4AA4A24789C16A4E3CE99A07112556@mailserver.ncw-av.com...
Simple. Parameters of the type you described, with the ?, = and &, etc. are
specific to URLs and are handled by CGI, common gateway interface, i.e. the
web server. See the PHP documentation on $argc[] and $argv[] if you want to
pass parameters on the command line.
http://us2.php.net/manual/en/features.commandline.php
Your question mark directly after the file name is confusing DOS.
Parameters on the DOS command line need to be separated from the file name
by a space.
Essentially, $argc is your argument count and $argv is an array of the
values of the arguments.
You won't be able to use $_GET when working with variables from the command
line. It wouldn't be wise to design one script that works from either the
command line or the web browser, plus it would be a major pain in the ass.
Luck,
Colin Teubner
-----Original Message-----
From: Evan [mailto:evan80@libero.it]
Sent: Monday, July 29, 2002 1:07 PM
To: php-general@lists.php.net
Subject: [PHP] php.exe from command line
I've made a simple php file that creates a file named 'agent_1.txt' where
the number is taken from $_GET["num"].
I've tried to run it in this way:
http://localhost/agent.php?num=1
And it works perfectly
I thought that from from command line it would work so i tried this (WinXP +
PHP 4.1.2):
c:\php\php.exe c:\Inetpub\webpub\PHP\agent.php?num=1
BUT IT DOESN'T WORK!!!!! ?
Can someone help, please?
Thenks in advance,
Evan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php