$postdata = http_build_query(
array(
'numg' => $numG,
'nump' => $numP,
'password' => $pass
)
);
$opts = array(
'ssl' =>
array(
'verify_peer' => false,
'verify_peer_name' => false,
),
'http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
)
);
$context = stream_context_create($opts);
$contents = file_get_contents($url, false, $context);
$xml = simplexml_load_string(html_entity_decode($contents));
if ($xml === false) {
echo "Error cargando XML\n";
foreach (libxml_get_errors() as $error) {
echo "\t", $error->message;
}
}
Comments