Jump to content

CURL returns blank pages when I use curl_setopt($curl, CURLOPT_RETURNTRANSFER,


gamak

Recommended Posts

Not sure why this happens. 

 

The code below works like a champ

$curl = curl_init( );
    curl_setopt($curl, CURLOPT_URL, "http://www.php.net");
    curl_exec($curl);
    curl_close($curl);

 

but the code below just gives me a blank page with absolutely no errors.  The only difference is i'm trying to capture the response and store it into a variable.

 

 $curl = curl_init( )
    curl_setopt($curl, CURLOPT_URL, "http://www.php.net");
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

    $result = curl_exec($curl);
    curl_close($curl);
    print $result;

 

 

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.