

cURL es una librería para la transferencia de archivos que soporta varios protocolos (FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS y FILE).
Instalacion de php curl:
Para ver si tenemos instalado curl:
En mi sistema Debian Lenny tengo instalado php5 pero ...
if (function_exists('curl_init')) { print "Ok, curl support
"; }
else { print "BadNews, No curl support
"; }
?>
BadNews, No curl support
Para instalarlo:
# aptitude install php5-curl
# /etc/init.d/apache2 restart
y...
Ok, curl support
(en dos pasitos esta hecho, estas son la cositas que hacen querer a debian)
Manejo de php curl:
Ref:$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,
"http://www.misnotaslinux.blogspot.com");
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$resultado = curl_exec ($ch);
print_r($resultado);
continuará ...
cURL básico
cURL avanzado
No hay comentarios:
Publicar un comentario