Possible Duplicate:
PHP passing $_GET in linux command prompt
i want execute php file with Shell script but i dont know how i can pass GET variables.
This script “php script.php?var=data” don’t work because Shell can’t find the file “script.php?var=data”.
So ,do you know how i can pass my variables ? If it’s really impossible to use GET variable, can i pass variables by an other way and use it in my php script ?
If you’re executing your script via the command-line (such as
php your_script.php), you will not be able to use the$_GETparameters, as you’re experiencing.However, you can make use of PHP’s CLI which graciously gives you the
$argvarray.To use it, you will call your script like this:
Inside your script, you can access the variables with: