...

View Full Version : Curl timeout breaks script



kristallaju
11-05-2009, 03:40 PM
So im having difficulties with skipping timeout error in curl
my script calls different functions my problem is lets say if in function2 is curl timeout error it wont continue with function3 but kills entire script. Is there any way to skip function2 (if there is timeout error) and continue with function3



// Start calling functions

function1();
function2();
function3();
function4();
function5();

oesxyl
11-05-2009, 04:54 PM
you can control timeout, see the manual for curl_setopt, CURLOPT_TIMEOUT

http://www.php.net/manual/en/function.curl-setopt.php

you can use the return value to control the flow, see the manual for curl_exec, return values, for the rest of the question.

http://www.php.net/manual/en/function.curl-exec.php

best regards



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum