Re: How to give parameters to a console php-script?
| From: | DL Neil | Date: | Mon, 02 Dec 2002 14:09:13 +0000 |
| Subject: | Re: How to give parameters to a console php-script? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-126714@lists.php.net to get a copy of this message | ||
Hello Martin,
> I start a console app with
>
> php myscript.php4 (just prints "ok").
>
> How can I give parameters to it? I tried:
> php myscript.php4 myparameter
> php myscript.php4?myparameter
> php myscript.php4?param=myparameter
>
> But always php just returns without doing nothing (not even giving an
> error or printing "Ok"!) I'm using PHP 4.2.3. on Windows2000).
I'm using the same version/platform and things work fine (for me).
Manual: Chapter 23. Using PHP from the command line
You are correct the first time.
What do argv and argc tell you?
Is the php.ini file set up so that these variables are shown/valid?
Regards,
=dn