I have 3 PHP pages.
1.View.php : which calls another PHP page by using the onclick event (js)
echo "<td><a id='execute' href='' onclick='execute_upgrade_page($workflow_id,".$row['Task_Number'].","demo.php")' title='Click to Execute the workflow'>
<i class='fa fa-forward' style='font-size:16px'></i> </a></td>";
Javascript
function execute_upgrade_page(id,tnum,scriptName){
$.ajax({
url: scriptName,
method: "POST",
data: {
id: id,
tnum:tnum,
scriptName:scriptName
},
success: function(data) {
console.log(data);
}
});
}
in the demo.php script, I am doing isset of the values like the below - it's working.
if(isset($_POST['id']) && isset($_POST['tnum']) && isset($_POST['scriptName']))
{ }
Now I am not getting how to call this same script from any other PHP file? In another PHP page ie modify.php:
$get_script_name = "select * from details where `Workflow_Number` = $workflow_id and Task_Number = $task_num";
$check_prep_task_details=mysqli_query($con,$get_script_name);
if(mysqli_num_rows($check_prep_task_details) > 0)
{
while ($row = mysqli_fetch_array($check_prep_task_details)) {
$db_script = $row['Script_Name'];
if($db_script == "demo.php")
// here i need to redirect with 3 parameter.
}
}