, December 02, 2002 5:40 AM
Subject: [PHP] How to give parameters to a console php-script?
Hello!
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
Hello!
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
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
Hi,
What do argv and argc tell you?
Is the php.ini file set up so that these variables are shown/valid?
Undefined variable: argv - so I guess this is the problem ;-) What do I
have to change in the php.ini?
Martin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
ll I found a
register_argc_argv = On
in my php.ini, which should work then. But I also found, that I have to use
print Ok: .$_SERVER[argv][1];
instead of
print Ok: .$argv[1];
Martin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Martin,
Ah yes, the famous 'read the upgrade notes - gotcha'!
Well done, you figured it out...
=dn
ll I found a
register_argc_argv = On
in my php.ini, which should work then. But I also found, that I have to
use
print Ok: .$_SERVER[argv][1];
instead of
print Ok: .$argv[1];
Martin
Martin,
Ah yes, the famous 'read the upgrade notes - gotcha'!
Well done, you figured it out...
=dn
Thanx for your help, it pointed me in the right direction ;-)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
7 matches
Mail list logo