LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Pass Parameters to php from bash (https://www.linuxquestions.org/questions/linux-newbie-8/pass-parameters-to-php-from-bash-228504/)

iman00b 09-09-2004 04:51 AM

Pass Parameters to php from bash
 
Hi i'm trying to pass parameters to a php script called from command line

so i have a test.sh script that is like this

OUT=`php -q prova.php?P1=test`
echo $OUT


and a php script, prova.php,that is

...

$get = $P1;

.....

echo $get;
....



but something isn't working... what :D

ty 4 help

thebover 09-09-2004 12:50 PM

I am misunderstanding your request, are you trying to call a command from a php website, to run on your local machine? or are you trying to run a local script to load a php document?

iman00b 09-09-2004 05:30 PM

i've done it by myself thanks

the problem was that the register_globals and register_argv were set to false, so passing parameters to a php script from a command line was not working, i've created a php.ini for my enviorment and all works fine :D:D


All times are GMT -5. The time now is 05:32 PM.