Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

167
Views
How to call php page from another php function

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);
            }
        });
    } 
  1. 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']))
     { }
    
  2. 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. 
             }
     }
    
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!