Bonjour à tous,
Je cherche une méthode pour afficher une image d'un site distant et récupérer son cookie (captcha)
Avec curl j'arrive bien à récuperer le cookie mais l'image est afficher sous forme binaire, pouvez vous m'aider ?
Merci.
<?php
$url="https://127.0.0.1/captcha.png";
$useragent="Mozilla/5.0";
$referer=$url;
$ch=curl_init($url);
curl_setopt($ch,CURLOPT_COOKIEJAR,"cookies.txt");
curl_setopt($ch,CURLOPT_USERAGENT,$useragent);
curl_setopt($ch,CURLOPT_REFERER,$referer);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$data=curl_exec($ch);
echocurl_error($ch);
curl_close($ch);
echo$data;
?>