i am trying to call the shell script using php.
Here i have one ajax code that gets the that gets the drop down value & send the values to another php page(deleteslide.php).
The deleteslide.php gets the values from this page and calls the delete-slide.sh script with the parameters with values that has got from main page.
But when i run the code it is not calling the script...
How to solve this problem
here is what i have done:
main page(index.php)
AJAX Code:
$("#deleteslide").click(function()
{
var prjid=document.getElementById("project-list").value;
var unitid=document.getElementById("unit-list").value;
var slidid=document.getElementById("slide-list").value;
var d ='deleteslide.php?projectId='+prjid+'&unitNo='+unitid+'&slideNo='+slidid;
$.ajax({
url:d,
success:function(output)
{
alert(output);
}
});
});
deleteslide.php code:
<?php
$prtId =$_GET["projectId"];
$utNo=$_GET["unitNo"];
$sdeNo=$_GET["slideNo"];
$c='/var/www/createslides/gen-json-data/delete-slide.sh '.$prtId.' '.$utNo.' '.$sdeNo;
//print("$c");
$output=shell_exec($c );
print("$output");
?>
Here deleteslide.php is calling the delete-slide.sh script, but the script is not running....
What could be the problem??
How can i solve this??