Here I get a querystring depending upon the value from the command shell_exec().
I am receiving a value the querystring but shell_exec() is not working.
I am using a webcam connected to Raspberry pi 3 so the command in shell_exec() is to turn the webcam ON an OFF.
$output=shell_exec('sudo /etc/init.d/motion start')
code:
<?php
$status=$_GET['status'];
if($status == 'on')
{
$output=shell_exec('sudo /etc/init.d/motion start');
}
if($status == 'off')
{
$output=shell_exec('sudo /etc/init.d/motion start');
}
How do I solve the execution issue?