Google map latitude php problem.
Posted: Mon Nov 27, 2006 9:24 pm
feyd | Please use
Any ideas?
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I've created a google map that maps my users by IP address. I query hostip.info to get their geolocation but the problem is some of the results come back empty and hostip.info takes awhile to return the empty results.
I've done some research about sockets but I'm not sure how I would use it or even if I should.
Keep in mind that this code gives succesful results sometimes, but takes too long to time out if the results come back empty.
Anywho, here's my code inside my loop that provides the latitude and longitude for my map:Code: Select all
$results[$i]=file_get_contents("http://www.hostip.info/api/get.html?ip=$ip&position=true");
preg_match('/Latitude: (.*)/', $results[$i], $lat);
preg_match('/Longitude: (.*)/', $results[$i], $lon);feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]