Re: [WebDNA] IP Address to country

This WebDNA talk-list message is from

2008


It keeps the original formatting.
numero = 100577
interpreted = N
texte = --Apple-Mail-48-699657930 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Here is the code i use for redirecting some european clients to the correct landinpage in their language: [text]ipje=[ipaddress][/text] [math show=f]ipA=[getchars start=1&end=3][ipje][/ getchars]*256*256*256[/math] [math show=f]ipB=[getchars start=5&end=7][ipje][/getchars]*256*256[/ math] [math show=f]ipC=[getchars start=9&end=11][ipje][/getchars]*256[/math] [math show=f]ipD=[getchars start=13&end=15][ipje][/getchars][/math] [math show=t]ipValue=ipA+ipB+ipC+ipD[/math] [search db=databases/ geolocator .db &leRANGESTARTdatarq = [ipValue ]&RANGESTARTtype=num&geRANGEENDdatarq=[ipValue]&RANGEENDtype=num&max=1] [founditems] [text]country=[country2D][/text] [/founditems] [showif "[country]"="AT"][redirect url=de/][/showif] [showif "[country]"="DE"][redirect url=de/][/showif] [showif "[country]"="CH"][redirect url=de/][/showif] [showif "[country]"="FR"][redirect url=fr/][/showif] [showif "[country]"="IT"][redirect url=it/][/showif] [showif "[country]"="NL"][redirect url=nl/][/showif] [redirect url=splash.html] [/search] The db format is (first 3 from 85000 records): rangestartrangeendholderidcountry2Dcountry3Dcountry 5033164867108863ARIN572572800USUSAUNITED STATES 6710886483886079ARIN0USUSAUNITED STATES 100663296117440511ARIN0USUSAUNITED STATES 117440512134217727ARIN880329600USUSAUNITED STATES The processing time when the code is executed is a few millisecs on a dual 2.3 G5 x-serve Have fun! Bert Votsis Tel: +31 (0) 181 644 622 Mob: +31 (0) 6 290 55 880 Fax: +31 (0) 181 637 173 Mail: bert@votsis.com On Aug 23, 2008, at 3:28 PM, Stuart Tremain wrote: > 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: --Apple-Mail-48-699657930 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Here is the code i use for = redirecting some european clients to the correct landinpage in their = language:

[text]ipje=3D[ipaddress][/text]
[math show=3Df]ipA=3D[getchars = start=3D1&end=3D3][ipje][/getchars]*256*256*256[/math]
[math= show=3Df]ipB=3D[getchars = start=3D5&end=3D7][ipje][/getchars]*256*256[/math]
[math = show=3Df]ipC=3D[getchars = start=3D9&end=3D11][ipje][/getchars]*256[/math]
[math = show=3Df]ipD=3D[getchars = start=3D13&end=3D15][ipje][/getchars][/math]
[math = show=3Dt]ipValue=3DipA+ipB+ipC+ipD[/math]
[search = db=3Ddatabases/geolocator.db&leRANGESTARTdatarq=3D[ipValue]&RANGES= TARTtype=3Dnum&geRANGEENDdatarq=3D[ipValue]&RANGEENDtype=3Dnum&= ;max=3D1]
[founditems]
[text]country=3D[country2D][/te= xt]
[/founditems]
[showif "[country]"=3D"AT"][redirect= url=3Dde/][/showif]
[showif "[country]"=3D"DE"][redirect = url=3Dde/][/showif]
[showif "[country]"=3D"CH"][redirect = url=3Dde/][/showif]
[showif "[country]"=3D"FR"][redirect = url=3Dfr/][/showif]
[showif "[country]"=3D"IT"][redirect = url=3Dit/][/showif]
[showif "[country]"=3D"NL"][redirect = url=3Dnl/][/showif]
[redirect = url=3Dsplash.html]
[/search]


=
The db format is (first 3 from 85000 = records):


rangestart= rangeend= holder= id= country2D= country3D= country
5033164867108863ARIN= 572572800= US= USA= UNITED STATES
6710886483886079ARIN0USUSAUNITED = STATES
100663296117440511ARIN0USUSAUNITED = STATES
117440512134217727ARIN= 880329600= US= USA= UNITED STATES

The processing time when = the code is executed is a few millisecs on a dual 2.3 G5 = x-serve



Have fun!

Bert = Votsis
Tel: +31 (0) 181 644 = 622
Mob: +31 (0) 6 290 55 = 880
Fax: +31 (0) 181 637 = 173

On Aug 23, 2008, at 3:28 PM, Stuart = Tremain wrote:

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"<= br>"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 <talk@webdna.us>.
To unsubscribe, = E-mail to: <talk-leave@webdna.us>

= --Apple-Mail-48-699657930-- Associated Messages, from the most recent to the oldest:

    
  1. Re(2): [WebDNA] IP Address to country (ctapia@lemongroup.cl (=?ISO-8859-1?Q?Cristi=E1n?= Tapia) 2008)
  2. Re: [WebDNA] IP Address to country (Stuart Tremain 2008)
  3. Re: [WebDNA] IP Address to country (Bert Votsis 2008)
  4. RE: [WebDNA] IP Address to country ("Olin Lagon" 2008)
  5. Re: [WebDNA] IP Address to country (Christer Olsson 2008)
  6. [WebDNA] IP Address to country (Stuart Tremain 2008)
--Apple-Mail-48-699657930 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Here is the code i use for redirecting some european clients to the correct landinpage in their language: [text]ipje=[ipaddress][/text] [math show=f]ipA=[getchars start=1&end=3][ipje][/ getchars]*256*256*256[/math] [math show=f]ipB=[getchars start=5&end=7][ipje][/getchars]*256*256[/ math] [math show=f]ipC=[getchars start=9&end=11][ipje][/getchars]*256[/math] [math show=f]ipD=[getchars start=13&end=15][ipje][/getchars][/math] [math show=t]ipValue=ipA+ipB+ipC+ipD[/math] [search db=databases/ geolocator .db &leRANGESTARTdatarq = [ipValue ]&RANGESTARTtype=num&geRANGEENDdatarq=[ipValue]&RANGEENDtype=num&max=1] [founditems] [text]country=[country2D][/text] [/founditems] [showif "[country]"="AT"][redirect url=de/][/showif] [showif "[country]"="DE"][redirect url=de/][/showif] [showif "[country]"="CH"][redirect url=de/][/showif] [showif "[country]"="FR"][redirect url=fr/][/showif] [showif "[country]"="IT"][redirect url=it/][/showif] [showif "[country]"="NL"][redirect url=nl/][/showif] [redirect url=splash.html] [/search] The db format is (first 3 from 85000 records): rangestartrangeendholderidcountry2Dcountry3Dcountry 5033164867108863ARIN572572800USUSAUNITED STATES 6710886483886079ARIN0USUSAUNITED STATES 100663296117440511ARIN0USUSAUNITED STATES 117440512134217727ARIN880329600USUSAUNITED STATES The processing time when the code is executed is a few millisecs on a dual 2.3 G5 x-serve Have fun! Bert Votsis Tel: +31 (0) 181 644 622 Mob: +31 (0) 6 290 55 880 Fax: +31 (0) 181 637 173 Mail: bert@votsis.com On Aug 23, 2008, at 3:28 PM, Stuart Tremain wrote: > 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: --Apple-Mail-48-699657930 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Here is the code i use for = redirecting some european clients to the correct landinpage in their = language:

[text]ipje=3D[ipaddress][/text]
[math show=3Df]ipA=3D[getchars = start=3D1&end=3D3][ipje][/getchars]*256*256*256[/math]
[math= show=3Df]ipB=3D[getchars = start=3D5&end=3D7][ipje][/getchars]*256*256[/math]
[math = show=3Df]ipC=3D[getchars = start=3D9&end=3D11][ipje][/getchars]*256[/math]
[math = show=3Df]ipD=3D[getchars = start=3D13&end=3D15][ipje][/getchars][/math]
[math = show=3Dt]ipValue=3DipA+ipB+ipC+ipD[/math]
[search = db=3Ddatabases/geolocator.db&leRANGESTARTdatarq=3D[ipValue]&RANGES= TARTtype=3Dnum&geRANGEENDdatarq=3D[ipValue]&RANGEENDtype=3Dnum&= ;max=3D1]
[founditems]
[text]country=3D[country2D][/te= xt]
[/founditems]
[showif "[country]"=3D"AT"][redirect= url=3Dde/][/showif]
[showif "[country]"=3D"DE"][redirect = url=3Dde/][/showif]
[showif "[country]"=3D"CH"][redirect = url=3Dde/][/showif]
[showif "[country]"=3D"FR"][redirect = url=3Dfr/][/showif]
[showif "[country]"=3D"IT"][redirect = url=3Dit/][/showif]
[showif "[country]"=3D"NL"][redirect = url=3Dnl/][/showif]
[redirect = url=3Dsplash.html]
[/search]


=
The db format is (first 3 from 85000 = records):


rangestart= rangeend= holder= id= country2D= country3D= country
5033164867108863ARIN= 572572800= US= USA= UNITED STATES
6710886483886079ARIN0USUSAUNITED = STATES
100663296117440511ARIN0USUSAUNITED = STATES
117440512134217727ARIN= 880329600= US= USA= UNITED STATES

The processing time when = the code is executed is a few millisecs on a dual 2.3 G5 = x-serve



Have fun!

Bert = Votsis
Tel: +31 (0) 181 644 = 622
Mob: +31 (0) 6 290 55 = 880
Fax: +31 (0) 181 637 = 173

On Aug 23, 2008, at 3:28 PM, Stuart = Tremain wrote:

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"<= br>"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 <talk@webdna.us>.
To unsubscribe, = E-mail to: <talk-leave@webdna.us>

= --Apple-Mail-48-699657930-- Bert Votsis

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:

Separate SSL Server (1997) Search 1 Field Twice? (2004) Using EIMS instead of Emailer (1998) Not really WebCat - need HTML Grider (1997) U&P IIS concept (1998) F3 crashing server (1997) Text data with spaces in them... (1997) New command suggestion (1997) WCS Newbie question (1997) setting cookies with [setcookie] (1998) Re2: AAgghh!! Help, please. SSL strikes again. (1997) off topic fetch vs PCS photomaster (1997) Press Release hit the NewsWire!!! (1997) Eims vs WebDNA (2003) Adding to Cart (2004) Photo Album (2000) SetCookie / GetCookie Problem.... (2004) problems with WebCat-Plugin (1997) Rotating Banners ... (was LinkExchange) (1997) Request Time Out (1997)