Question Locked

shell_exec in .php with query string examples

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I want to run .php with querystring automatically using shell_exec in php. Please help me.

2 replies

by toivo talikka

If you want to use shell_exec from your PHP code, it is a program execution function which allows you to run a command like 'ls -al' in the operating system shell and get the result returned into a variable. Querystrings are not commands you can use in this way.

Do you mean running PHP from the command line so that it runs from the shell, not from the web server:
# php -r 'echo "hello world\n";'

If you run PHP 4.3 and above, you can use the PHP Command Line Interface (CLI) which can also execute scripts stored in files. Have a look at the syntax and examples at: http://php.net/features.commandline

This discussion is closed to new replies.