Anyone here who might know how I can pass a posted variable from Bash to a PHP script? When I run in Bash Code: php logit.php all is working fine, but when I try to add a variable like Code: php logit.php?takethis=123123 I get an error from Bash saying that the file can not be found! Calling Code: php logit.php?takethis=123123 from the website does work fine. The problem with Bash is the ?takethis=123123 part! Can the call with the ?takethis=123123 to the PHP page been done an other way in Bash?
Maybe you can add this function: Code: function getInput() { $fr = fopen("php://stdin", "r"); while (!feof ($fr)) { $input .= fgets($fr); } fclose($fr); return $input; } $takethis = getInput(); to your PHP script and then do something like this: Code: echo 123123 | php logit.php Of course, you should check the $takethis variable before you continue (to avoid that someone tries to pass harmful code to your script).