RE: [WebDNA] IP Address to country

This WebDNA talk-list message is from

2008


It keeps the original formatting.
numero = 100576
interpreted = N
texte = You can use this service http://www.ipgeo.com/api/ Or download the free ip database at http://www.maxmind.com/. This one will give you a city from an IP - http://www.maxmind.com/app/geolitecity I wrote some webdna some time ago to use the maxmind database and can dig up if you need. The math is like this...(from the site) ipnum = 16777216*w + 65536*x + 256*y + z (1) where IP Address = w.x.y.z The reverse of this formula is w = int ( ipnum / 16777216 ) % 256; x = int ( ipnum / 65536 ) % 256; y = int ( ipnum / 256 ) % 256; z = int ( ipnum ) % 256; Where % is the mod operator. -----Original Message----- From: Stuart Tremain [mailto:webdna@idfk.com.au] Sent: Saturday, August 23, 2008 3:29 AM To: talk@webdna.us Subject: [WebDNA] IP Address to country Hi All I have a db of ip address that match a country. Here is a sample "2.6.190.56","2.6.190.63","33996344","33996351","GB","United Kingdom" "3.0.0.0","4.17.135.31","50331648","68257567","US","United States" "4.17.135.32","4.17.135.63","68257568","68257599","CA","Canada" "4.17.135.64","4.17.142.255","68257600","68259583","US","United States" "4.17.143.0","4.17.143.15","68259584","68259599","CA","Canada" "4.17.143.16","4.18.32.71","68259600","68296775","US","United States" "4.18.32.72","4.18.32.79","68296776","68296783","MX","Mexico" "4.18.32.80","4.18.40.135","68296784","68298887","US","United States" "4.18.40.136","4.18.40.143","68298888","68298895","CA","Canada" "4.18.40.144","4.18.65.255","68298896","68305407","US","United States" How do I work out the range for the reported ip address. If my IP address was 4.17.138.121 it would fall into the fourth record range, is there a trick with the IP address to work out the search range ? Regards Stuart Tremain IDFK Web Developments 114a/40 Yeo Street, Neutral Bay NSW 2089 ph: +612 9908 2134 fax: +612 9908 2134 --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] IP Address to country (Stuart Tremain 2008)
  2. Re: [WebDNA] IP Address to country (Bert Votsis 2008)
  3. RE: [WebDNA] IP Address to country ("Olin Lagon" 2008)
  4. Re: [WebDNA] IP Address to country (Christer Olsson 2008)
You can use this service http://www.ipgeo.com/api/ Or download the free ip database at http://www.maxmind.com/. This one will give you a city from an IP - http://www.maxmind.com/app/geolitecity I wrote some webdna some time ago to use the maxmind database and can dig up if you need. The math is like this...(from the site) ipnum = 16777216*w + 65536*x + 256*y + z (1) where IP Address = w.x.y.z The reverse of this formula is w = int ( ipnum / 16777216 ) % 256; x = int ( ipnum / 65536 ) % 256; y = int ( ipnum / 256 ) % 256; z = int ( ipnum ) % 256; Where % is the mod operator. -----Original Message----- From: Stuart Tremain [mailto:webdna@idfk.com.au] Sent: Saturday, August 23, 2008 3:29 AM To: talk@webdna.us Subject: [WebDNA] IP Address to country Hi All I have a db of ip address that match a country. Here is a sample "2.6.190.56","2.6.190.63","33996344","33996351","GB","United Kingdom" "3.0.0.0","4.17.135.31","50331648","68257567","US","United States" "4.17.135.32","4.17.135.63","68257568","68257599","CA","Canada" "4.17.135.64","4.17.142.255","68257600","68259583","US","United States" "4.17.143.0","4.17.143.15","68259584","68259599","CA","Canada" "4.17.143.16","4.18.32.71","68259600","68296775","US","United States" "4.18.32.72","4.18.32.79","68296776","68296783","MX","Mexico" "4.18.32.80","4.18.40.135","68296784","68298887","US","United States" "4.18.40.136","4.18.40.143","68298888","68298895","CA","Canada" "4.18.40.144","4.18.65.255","68298896","68305407","US","United States" How do I work out the range for the reported ip address. If my IP address was 4.17.138.121 it would fall into the fourth record range, is there a trick with the IP address to work out the search range ? Regards Stuart Tremain IDFK Web Developments 114a/40 Yeo Street, Neutral Bay NSW 2089 ph: +612 9908 2134 fax: +612 9908 2134 --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: "Olin Lagon"

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

wrong authentication (1998) Location of Browser Info.txt file (1997) [WebDNA] Successful, working WebDNA7/CentOS install? (2013) UPS uber integration (2007) Re(2): Problem about [CART] number (1998) OUTSIDE LINKS TO SHOW SHOPPING CART????????? (1998) WebCat for mass emailings (1997) SERIAL NUMBER PROBLEM *AGAIN*!!! (1998) Formating found categories (1997) RE: Adding a product from another site (1997) A multi-processor savvy WebCatalog? (1997) Security for malls with different webmasters (1998) no template caching (1997) shipping costs (1997) Archives... (1997) cybercash (1998) [WebDNA] Code Library (2013) Database changes (1998) upgrading (1997) Re:EMail not being sent (1999)