I have a script that I can usually access like this:
http://www.example.com/index.php?p1=a1&p2=b1
If I try to do this using shell_exec, how would I pass the arguments in? This doesn't work:
shell_exec("php index.php p1=a1 p2=b1");
I have a script that I can usually access like this:
http://www.example.com/index.php?p1=a1&p2=b1
If I try to do this using shell_exec, how would I pass the arguments in? This doesn't work:
shell_exec("php index.php p1=a1 p2=b1");
You can't use GET, POST or REQUEST from the console as they are HTTP request methods. You have to use argv, like the comments said.
If you can't modify the script to use it, you might need to build some sort of a bridge script which will convert the arguments into a GET or POST parameters and then call/fetch the original script with them. Not sure if it's worth the hassle though.
Thats not possible. GET Parameters need a GET Request to exist.
If there is no other way, you can "download" (and call) your file like this:
<?php
$resp = file_get_contents("http://www.example.com/index.php?p1=a1&p2=b1");
echo "GET call returned: $resp";
?>