Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

170
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda