Page 1 of 1

PHP with timeout

PostPosted: Sat Mar 04, 2006 7:36 am
by jimbo
Hi folks,

I want to use this service, specifically using the format. However, I want to be able to set a timeout in PHP so that if I don't get a response after say, 0.5s the PHP script gives up trying (so that display of the page is not excessively slowed down for the user). Can anyone tell me what the best way to implement this in PHP is?


PostPosted: Mon Mar 20, 2006 6:40 am
by Mister
Try to use
Code: Select all
fsockopen($host, 80, $errno, $errstr, 2);

in your code

PostPosted: Mon Jan 29, 2007 12:45 am
by Brian121
Hi folks, I want an easy HTTP oriented API to locate IP addresses and Geocode. That;s why I attached this code In my ASP page.

City: Sugar Grove, IL ... ition=true
City: Sugar Grove, IL
Latitude: 41.7696
Longitude: -88.4588
[use the URL above for an example - XML too long to paste below]

But Now it's giving me 24746## Error. Plz tell me what to do..