How to use variable in php using exec shell?

Would you help me please to solve my issue .. my problem that i my shell command didn’t take the variable in my php code so can you tell if what i write is wrong or not ?

$output1=shell_exec("/etc/init.d/nfsen --add-profile" . $_POST['group_name'] . "expire=0 maxsize=0 shadow=1");
echo "<pre>$output1</pre>";

i have this error in my console

POST addProfile.php 404 (Not Found)

even my addprofile.php and my index.php is on the same directory so what could be the problem? thankyou i advance

Source: shell

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.