Hello,
I'm training this cURL. Can you tell me why the following snippet does not work?
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<?php
$cURL = curl_init('http://fiesselecaoaluno.mec.gov.br/consulta/curso');
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
$dados = array(
'opcaoProcurar' => 'I',
'noIes' => '10',
);
curl_setopt($cURL, CURLOPT_POST, true);
curl_setopt($cURL, CURLOPT_POSTFIELDS, $dados);
curl_setopt($cURL, CURLOPT_REFERER, 'http://fiesselecaoaluno.mec.gov.br/consulta/curso');
$resultado = curl_exec($cURL);
curl_close($cURL);
echo $resultado;
?>
</body>
I wanted to get the html with cURL, but only dps of it have filled out the form correctly. Any tips?
Is it something to do with the page form, or is it because it is ajax and curl does not work for this?