Jump to content

Curl won't display image.


Nuv

Recommended Posts

I am using this basic code to capture the data using Curl. However the $result won't echo any of the images. How can i capture images too ?

 

<?php
$url = "http://www.hot.com/xxx.php";
$variables = "post=fields"; 
  $ch = curl_init();
    
       curl_setopt($ch, CURLOPT_POST, 1 );
       curl_setopt($ch, CURLOPT_POSTFIELDS, $variables);
     
    curl_setopt ($ch, CURLOPT_URL, $url);
    curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.001 (windows; U; NT4.0; en-us) Gecko/25250101");
    curl_setopt ($ch, CURLOPT_HEADER, 0);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
    $result = curl_exec ($ch);
    curl_close ($ch); 
    
    echo $result;
?>

Link to comment
https://forums.phpfreaks.com/topic/239474-curl-wont-display-image/
Share on other sites

Archived

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.