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-699657930Content-Type: text/plain;charset=US-ASCII;format=flowed;delsp=yesContent-Transfer-Encoding: 7bitHere 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):rangestartrangeendholderidcountry2Dcountry3Dcountry5033164867108863ARIN572572800USUSAUNITED STATES6710886483886079ARIN0USUSAUNITED STATES100663296117440511ARIN0USUSAUNITED STATES117440512134217727ARIN880329600USUSAUNITED STATESThe processing time when the code is executed is a few millisecs on a dual 2.3 G5 x-serveHave fun!Bert VotsisTel: +31 (0) 181 644 622Mob: +31 (0) 6 290 55 880Fax: +31 (0) 181 637 173Mail: bert@votsis.comOn 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-699657930Content-Type: text/html;charset=US-ASCIIContent-Transfer-Encoding: quoted-printableHere 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
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>
=blockquote>
=--Apple-Mail-48-699657930--
Associated Messages, from the most recent to the oldest:
--Apple-Mail-48-699657930Content-Type: text/plain;charset=US-ASCII;format=flowed;delsp=yesContent-Transfer-Encoding: 7bitHere 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):rangestartrangeendholderidcountry2Dcountry3Dcountry5033164867108863ARIN572572800USUSAUNITED STATES6710886483886079ARIN0USUSAUNITED STATES100663296117440511ARIN0USUSAUNITED STATES117440512134217727ARIN880329600USUSAUNITED STATESThe processing time when the code is executed is a few millisecs on a dual 2.3 G5 x-serveHave fun!Bert VotsisTel: +31 (0) 181 644 622Mob: +31 (0) 6 290 55 880Fax: +31 (0) 181 637 173Mail: bert@votsis.comOn 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-699657930Content-Type: text/html;charset=US-ASCIIContent-Transfer-Encoding: quoted-printableHere is the code i use for =redirecting some european clients to the correct landinpage in their =language:
[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]
[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