1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| <?php
$res = fopen("log.txt",'w');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://mail.google.com/mail/feed/atom");
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch,CURLOPT_VERBOSE,1);
curl_setopt($ch,CURLOPT_STDERR,$res);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt($ch,CURLOPT_HTTPAUTH,CURLAUTH_ANY);
curl_setopt($ch,CURLOPT_USERPWD,"###:###");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$bool = curl_exec($ch);
if ($bool) echo "cool"; else echo "raté<br>";
echo curl_error($ch);
fclose($res);
?> |
Partager