tags:

views:

122

answers:

3

Here is the website http://www.ip-adress.com/ip_tracer/ i want to get latitde and lognitude from there using php and pass it to mySQL DBase, how can i achieve that?

+1  A: 

You want to do screen scraping. In PHP you can use cURL. It will allow you to interact with the website similar to how the browser would. After you will then need to parse the page to filter out the portion you are looking for. You can do this with regular expressions and/or strpos().

Although, be warned that the website may start blocking you if they notice too many requests coming from one IP address.

There are databases you can purchase and services you can use that do this same process.

Darryl Hein
+2  A: 

one way to do it would be to use googles API.

http://code.google.com/intl/de/apis/ajax/documentation/ google.loader.ClientLocation

another way to do it to use this: http://www.maxmind.com/app/ip-location

Thomaschaaf
how would i do that?
If you expect us to hold your hand the whole way, you've got a nasty surprise coming. If you can't figure it out yourself, maybe you've got some more reading to do.
Alex Fort
+2  A: 

How about you just use the free API provided by hostip.info? That would be a pre-made solution for you, and you wouldn't have to futz around with screen-scraping.

Alex Fort
seems to be off by a couple hundred kilometers..
Thomaschaaf
Sometimes that site isn't incredibly accurate, but it's always worked with good accuracy for me.
Alex Fort
yes it seems to be off, any other free service you migh know of?