papaface Posted March 30, 2009 Share Posted March 30, 2009 Hello, I am trying to work with the API for my website. Basically I need to load a specific url to instigate a series of functions. The API will call back my script later automatically. I am trying to find a reliable way of invoking a given URL so that it starts processing the API file BUT I don't want php to sit and wait until the API has finished doing its stuff. I want to update a field in my database when the API is run. I have tried if (get_headers($url)), but this takes to long. I have tried if (curl_exec($ch)) with timeout, but this is unreliable as it seems to start counting the moment curl is exec'd rather than the time from when the url is successfully loaded. I have tried file_get_contents($url), but like curl this is unreliable. Does anyone have any other ideas as to how I could do this? Any help would be appreciated! Link to comment https://forums.phpfreaks.com/topic/151781-open-a-url-location-with-timeout/ Share on other sites More sharing options...
papaface Posted March 30, 2009 Author Share Posted March 30, 2009 Anyone? :'( Link to comment https://forums.phpfreaks.com/topic/151781-open-a-url-location-with-timeout/#findComment-797213 Share on other sites More sharing options...
papaface Posted March 31, 2009 Author Share Posted March 31, 2009 Oh well I guess this is to much of a challenge. Link to comment https://forums.phpfreaks.com/topic/151781-open-a-url-location-with-timeout/#findComment-797914 Share on other sites More sharing options...
lostnucleus Posted March 31, 2009 Share Posted March 31, 2009 i didnt get completly wat you want to do , but you are left with only one other way of connecting , i.e by using sockets fsockopen($url,$port,$errno,$errstr,$yourTimeOut); ........hope this will help Link to comment https://forums.phpfreaks.com/topic/151781-open-a-url-location-with-timeout/#findComment-797933 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.