huji
asked on
basic cURL question
Here is my code:
$curl_handle = curl_init($url) or die('You need cURL installed to use this tool.');
curl_setopt($curl_handle, CURLOPT_HEADER, 0);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
How do I get the response comming from that url? (And I don't want to set returntransfer to 0.)
Huji
$curl_handle = curl_init($url) or die('You need cURL installed to use this tool.');
curl_setopt($curl_handle, CURLOPT_HEADER, 0);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
How do I get the response comming from that url? (And I don't want to set returntransfer to 0.)
Huji
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I've found my mistake. Everything except the content is there. I get the header the way I usually do:
print curl_exec($curl_handle);
Thanks for your help.
Huji
print curl_exec($curl_handle);
Thanks for your help.
Huji
ASKER
Array ( [url] => http://www.google.com/ [content_type] => text/html [http_code] => 200 [header_size] => 302 [request_size] => 101 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 1.125 [namelookup_time] => 0.016 [connect_time] => 0.438 [pretransfer_time] => 0.438 [size_upload] => 0 [size_download] => 3042 [speed_download] => 2704 [speed_upload] => 0 [download_content_length] => 0 [upload_content_length] => 0 [starttransfer_time] => 0.906 [redirect_time] => 0 )
The page content (the HTML in this case) is not there.