Forum Moderators: coopster

Message Too Old, No Replies

Validating my php Curl function

         

BlackRaven

3:34 pm on Apr 14, 2007 (gmt 0)

10+ Year Member



The following code works perfectly, however is there some thing that i should be on the look out for...infinite loop, bad page results etc...

$ch = curl_init("http://example.com/");
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,5);
curl_setopt($ch, CURLOPT_LOW_SPEED_LIMIT, 5);
curl_setopt($ch, CURLOPT_LOW_SPEED_LIMIT, 20);
curl_setopt($ch, CURLOPT_MAXREDIRS, 2);
curl_setopt($ch, CURLOPT_TIMEOUT, 300);
curl_exec($ch);
curl_close($ch);

Little_G

4:37 pm on Apr 14, 2007 (gmt 0)

10+ Year Member



Hi,

You have CURLOPT_LOW_SPEED_LIMIT set twice.

Andrew

cameraman

4:41 pm on Apr 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Cool, looks like you're off to the races already.
For your purposes, you may want to include the header and look for a response code 200.