Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

171
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda