How to call another PHP page within a PHP page

4

Galera,

I have a PHP page and now I need to call another PHP page by passing the parameters I have collected from my DB.

How can I do this?

I've tried this, but it was not!

$qry_str = "id=".$id_mensagem;
$ch      = curl_init();

// Set query data here with the URL
curl_setopt($ch, CURLOPT_URL, '/postar_reenvio.php?' . $qry_str);
//$url = "http://www.google.com/search?q=".$strSearch."&hl=en&start=0&sa=N";

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
$content = trim(curl_exec($ch));
print_r($content);
curl_close($ch);
    
asked by anonymous 26.06.2017 / 15:35

1 answer

1

If I understood your question well, it should be your solution.

   // Obter os recursos de cURL 
    $curl = curl_init();

    curl_setopt_array($curl, array(
        CURLOPT_URL => 'http://testcURL.com/?item1=value&item2=value2'
    ));
    // enviar o request  & guarda a resposta em $resp
    $resp = curl_exec($curl);
    // fechar o request
    curl_close($curl);
    
26.06.2017 / 15:51