A
Anonymous
Guest
Hi all,
I need to execute a command-line program through PHP.
I have a form which includes a textarea, where the user writes his data.
These data will be used as input for the commend-line program.
Will I go something like:
$data = $_GET['info'];
Which function shall I use? System, exec, shell_exec, passthru?
I can't choose which one is the correct.
By the way, the command which I use when I write the script in the command line is :
program_name [argument1 -> A database file] [argument2 -> info supplied by user]
So, in the function that will be used, the data supplied by the user will be passed as my second argument (the 1st argument is a file in my hard disk).
And, lastly, do I need to change any global settings for PHP in order to perform such actions, ie running scripts via PHP programs???
Thanx a lot!
I need to execute a command-line program through PHP.
I have a form which includes a textarea, where the user writes his data.
These data will be used as input for the commend-line program.
Will I go something like:
$data = $_GET['info'];
Which function shall I use? System, exec, shell_exec, passthru?
I can't choose which one is the correct.
By the way, the command which I use when I write the script in the command line is :
program_name [argument1 -> A database file] [argument2 -> info supplied by user]
So, in the function that will be used, the data supplied by the user will be passed as my second argument (the 1st argument is a file in my hard disk).
And, lastly, do I need to change any global settings for PHP in order to perform such actions, ie running scripts via PHP programs???
Thanx a lot!