Jump to content

setting cookie in curl does not work


Recommended Posts


today i was checking a site as i m learning more about curl. i see i was not able to get image with curl.

they have stopped hotlinking and was not finiding anyway to show me image on my localhost so making this thread for any pro help.


here is my code:

$ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "http://www.pixhost.org/show/2019/5530476_banner.png");
    curl_setopt($ch, CURLOPT_USERAGENT, "Opera/9.80 (Windows NT 5.1; U; en) Presto/2.5.24 Version/10.54");
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
   curl_setopt($ch, CURLOPT_COOKIE, 'pixhostads=1');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $result = curl_exec ($ch);
echo $result ;

if i run that script it will show me that page but it says pictures is hotlinked and cant display, so i tried to see cookie but i m not sure if i am doing it right. on that url u must need to click "Click to continue" before u can see image.


Please can someone help why its not showing me the correct image and any way to pass it?


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.