html - How can i pass a program name throgh php to a to a shell script file? -
I am sending a file name through the HTML file where I am running a shell script, I would like to send the script in the form of logic. $ prg1 = $ _ POST ['prg1']; I am importing this file from user input shell_exec ('./ shell.sh') and I want to send that file to this script. Any help?
Use escapeshellarg to add an appropriate quote, and then it Add as a logic to the script.
shell_exec ('. / Shell.sh'. Escapeshellarg ($ prg1)); The script can then receive $ 1 as the argument.
For many arguments, separate them with space:
shell_xac ('. / Shell.sh'. Escapehalarg ($ prg1). "" Escapehalarg ( $ Prg2). '' Eskephelrel ($ prg3));
Comments
Post a Comment