Afficher un message
Vieux 27/03/2008, 21h27   #3
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHP CLI: Sending parameters via command line

Defranco wrote:
> Hi all,
>
> How do a run a .php file via shell script (CLI ) but providing
> parameters?
>
> For example to run foo.php in unix I run the command:
>
> php foo.php
>
> But how do I pass parameters like in web interface: foo.php?
> param1=value&param2=value2 via command Line?
>
> The command:
>
> php foo.php?arg1=value&arg2=value2
>
> Will not work and the just explain how to pass arguments that I
> understand that is not parameters like in web - I can not modify
> foo.php to make it get arguments, only standard web parameters
> (retrieved via $_GET ).
>
> Thanks
>
> Erico
>


Just like you pass PHP arguments (like the script name):

php script.php arg1 arg2 arg3

php -? provides this information.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
 
Page generated in 0,04862 seconds with 9 queries