I am using this code header('Location: http://example.com/test.php?number='.$requestsDone.'');
But looks like it is not working, what is wrong here?
Let me know, if you need more information.
See Question&Answers more detail:osI am using this code header('Location: http://example.com/test.php?number='.$requestsDone.'');
But looks like it is not working, what is wrong here?
Let me know, if you need more information.
See Question&Answers more detail:osProducing a header in a command line script doesn't make any sense. The header is part of the HTTP protocol, there is no HTTP involved when the script is executed using the CLI version of PHP.
Accordingly, the header()
function is not implemented in the CLI version of PHP. It exists, but it doesn't produce any output.
Also, the superglobals that contain information extracted from the HTTP request ($_GET[]
, $_POST[]
, $_REQUEST[]
, $_FILES[]
, $_COOKIE[]
etc) exist but they are empty.
In order to pass arguments to a script using the command line, use the $argc
and $argv[]
variables.