ip location lookup

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cleary1981
    New Member
    • Jun 2008
    • 178

    ip location lookup

    Hi,

    Can anyone tell me how I can get the users ip address and location? Do the ip addresses fall into different ranges per country or something?
  • iam_clint
    Recognized Expert Top Contributor
    • Jul 2006
    • 1207

    #2
    I believe you have to have a database of ip's->Country->State->City
    and use ajax to query this database

    Related Links
    IP Address Geolocation to Country, City, Region, Latitude, Longitude, ZIP Code, ISP, Domain, Time Zone, Area Code, Mobile Data, Usage Type, Elevation and so on.

    Comment

    • freddieMaize
      New Member
      • Aug 2008
      • 85

      #3
      Hi,

      A simple search in google will tell you a lot :). Anyway, as of me, there are ways to find the ip of the client using java and i believe there are also javascript ways of doing it.

      And about your next question,
      Do the ip addresses fall into different ranges per country or something?
      again, as of my knowledge, YES.

      fREDDIE

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Not with JavaScript. You could use some Java (with permissions on some browsers) or server-side code.

        Comment

        • cleary1981
          New Member
          • Jun 2008
          • 178

          #5
          Yeah I think purchasing the db is the way to go. thanks guys was just looking for a cheaper option

          Comment

          • Rsmastermind
            New Member
            • Sep 2008
            • 93

            #6
            Hi You can't trace the actual IP of the machine If you are using Internet.
            As this comes after masking by router.But anyways you can get that in local intranet perfectly and upto much in internet as
            Code:
            HttpServletRequest reg = 
            (HttpServletRequest)FacesContext.getCurrentInstance).getExternalContext).getRequest();//Instance creation You can create of your own in your manner
                   reg.getRemoteUser();
            	    	reg.getRemoteHost();
            	    	reg.getRemotePort();
            	    	reg.getRemoteAddr();
            With these all you can have user related information

            Comment

            • nanjupuram
              New Member
              • Jun 2013
              • 1

              #7
              Hi,
              I don,t have that much idea about finding the users Ip address ,But if you have some ones IP address you can find the location of the IP address by using the site IP-Details.com. And those locations are not the perfect location of the user because the IP you are providing will some how shows the origin only .
              Last edited by acoder; Jun 26 '13, 12:09 PM.

              Comment

              Working...