PDA

View Full Version : How to get IP Location?



FastBurst
09-01-2006, 11:03 PM
hey Guys I am new to the board, but I will give this a shot.

I am working on an invoice system and I want to be able to do is list the IP and its location

Example I know using the:
<%
Request.ServerVariables("REMOTE_HOST")
%>
gives me the IP address. Is there a way to drill down further.

Example down to the country and city?
I have seen it done on a few order forms when placing orders I want to know how I can drill down on this as well.

THanKS

FastBurst

SWD69
09-08-2006, 01:32 PM
Hi

Think there's something on w3 schools, see this example:

http://www.w3schools.com/asp/showasp.asp?filename=demo_server

While doing some Google Map research also found this cool tool.

http://www.rleeden.no-ip.com/geotool.php

No good to you but interesting all the same :O)

Cheers

Munro
09-12-2006, 03:07 PM
One solution is to use JS:

<script>
var my_url=document.URL;
var root_url=my_url.indexOf('Link.asp');
document.write(my_url.substring(0,root_url));
</script>

In this example I wanted just the url and not the actual asp file name

Steven V.S. Cat
02-05-2007, 06:57 AM
Are you plan to build a system link this ?
http://wwwvpn.privacyconnector.com:22080/services/iptolocationconverter.aspx

http://www.privacyconnector.com

You first need a database contain a mapping between IP and location. You can find this kind of database from some warez homepage

djr33
02-05-2007, 08:35 PM
Well, there's some related info on this using PHP here--
http://www.dynamicdrive.com/forums/showthread.php?t=15036

Using the same data and method, you could convert to ASP and go from there. (Or just switch to PHP and use the script supplied there if you'd prefer.)


Note: it's a fairly long discussion... starts being helpful mid-page-2.)

codeexploiter
02-06-2007, 07:59 AM
I think using something like this one (http://www.ip2country.net/ip2country/ip_country.html) will solve your problem completely.

djr33
02-07-2007, 06:16 PM
I'm guessing that's similar to the solution used in the thread I linked to-- http://www.maxmind.com/app/geoip_country

Probably worth looking into. However... the link isn't loading for me.

EDIT: Now it loads, but looks like it costs $50. The one linked to above also is $50, I believe, but there is a free 'limited' version to use, which seems like it would probably do just fine.

Twey
09-05-2008, 08:47 AM
The industry standard is MaxMind GeoIP (http://www.maxmind.com/app/php).

kanaga
07-08-2009, 11:58 AM
U get the IP location of an IP address by using http://www.ip-details.com/ip-search/.

mialye
01-18-2010, 02:31 AM
You can check out the open source APIs and source codes for different programming languages from http://www.ip2location.com/developers.aspx