<?php
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, "http://www.php.net");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec ($curl);
curl_close ($curl);
print $result;
?>
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL,"http://localhost/posttest.php");
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, "Hello=World&Foo=Bar&Baz=Wombat");
curl_exec ($curl);
curl_close ($curl);
?>
http://php.net/manual/en/function.curl-setopt.php
http://www.hackingwithphp.com/15/10/2/your-first-curl-scripts
No hay comentarios:
Publicar un comentario