M
M
m4f12020-12-12 02:35:07
PHP
m4f1, 2020-12-12 02:35:07

Shell in php with output?

Hello, you need to execute commands using a specific mask through the php front on the server:

bash new.sh FIELD1 FIELD2 FIELD3 FIELD4
bash new.sh FIELD1 FIELD2 FIELD3 FIELD4

field - the arguments that the person enters.
When adding a line, it must be executed as a separate command
. Also, the result of the execution should be displayed as an echo response

. How to do this correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Justings, 2020-12-12
@Justings

Bonally

$val1 = 'ПОЛЕ1';
$val2 = 'ПОЛЕ2';
$val3 = 'ПОЛЕ3';
$val4 = 'ПОЛЕ4';
$shell = shell_exec("new.sh {$val1} {$val2} {$val3} {$val4}");
echo $shell;

Maybe I misunderstood something :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question