<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-6697244717008085794</atom:id><lastBuildDate>Sun, 01 Sep 2024 02:22:28 +0000</lastBuildDate><title>IP Geolocation</title><description>Cutting Edge IP Address Geolocation Technology</description><link>http://ipgeolocation.blogspot.com/</link><managingEditor>noreply@blogger.com (Unknown)</managingEditor><generator>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6697244717008085794.post-4085459871063846352</guid><pubDate>Thu, 19 Nov 2009 04:19:00 +0000</pubDate><atom:updated>2009-11-22T21:28:35.130-08:00</atom:updated><title>Targeted Online Advertising by Country using .NET Framework in VB.NET or C#</title><description>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://www.ip2location.com/ip2location-dotnet-component.aspx&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 116px; height: 158px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvja8rd6lX7Sr7kRmsylXHLiI8BF5nN2KiJFnQjKQBfm6HKZzqgiahoNm9iHxsIuhFZ6C7BJpHWF0_Y_doGH1alRQyq8SWJqcmI155fILqsL2pcAvYCNmJNDz2XmpOty1xz2CMRR1C1QeW/s320/net_05.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5405670502909303970&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://www.ip2location.com/ip2location-activex.aspx&quot; target=&quot;_blank&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;div style=&quot;font-family: arial; font-size: 9pt;&quot;&gt;The global nature of websites is such that to maximize your earnings from online advertisements, you have to display different advertisements for visitors from different countries. This way, your web visitors will only see advertisements that are relevant to their country and thus be more inclined to click on those advertisements. In the long term, this will help to boost your revenue from the advertisements.&lt;br /&gt;&lt;br /&gt;In this example, we will use a fully functional &lt;b&gt;IP2Location™ .NET component&lt;/b&gt; available at &lt;a href=&quot;http://www.ip2location.net/download/IP2LocationDotNetComponent.ZIP&quot; target=&quot;_blank&quot;&gt;http://www.ip2location.net/download/IP2LocationDotNetComponent.ZIP&lt;/a&gt; to determine the visitor’s country by their IP address. Firstly, install the IP2Location™ .NET component. Once installation is complete, get the &lt;b&gt;IP2Location.DLL .NET component&lt;/b&gt; and sample database from the directory, i.e. &lt;b&gt;C:\Program Files\IP2Location&lt;/b&gt; by default. You need to add a reference to this component from your Visual Studio web project. A copy of this component will be copied into &lt;b&gt;/bin&lt;/b&gt; directory under the project. If the component is unregistered, there is a random 5-second delay in one out of ten queries.&lt;br /&gt;&lt;br /&gt;To avoid any delays in the query, you can consider purchasing the &lt;a href=&quot;http://www.ip2location.com/ip2location-dotnet-component.aspx&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;IP2Location™ .NET Component Version 3.0&lt;/b&gt;&lt;/a&gt;, which is a software development component and data solution for .NET Framework. You can then dynamically tailor the content of your site based on your visitors country, region, city, latitude, longitude, ZIP code, ISP, domain name, timezone, connection speed, IDD code, area code, weather statation code, and weather station name.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6KK6fIcTTTeJ6YbblefYKRuNOQeNU4tR1aGNYE5omCKWW5K-fbqWS8A2qT7kqAECDiJLzhRWLuZgv3FX-PHCAaCxNt1Qs_iJgA6_Ns3bw2J3KA_oTbz6PKW7A7yCEbRObGWGJbqmXq_NM/s1600/IP2Location-NETComponent.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 214px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6KK6fIcTTTeJ6YbblefYKRuNOQeNU4tR1aGNYE5omCKWW5K-fbqWS8A2qT7kqAECDiJLzhRWLuZgv3FX-PHCAaCxNt1Qs_iJgA6_Ns3bw2J3KA_oTbz6PKW7A7yCEbRObGWGJbqmXq_NM/s320/IP2Location-NETComponent.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5405669277450327730&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Below is the sample code in VB.NET and C# webform which will display the targeted online advertising by country.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Sample Codes in VB.NET Webform&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;Imports IP2Location&lt;br /&gt;Private Sub Query(ByVal strIPAddress As String)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Dim oIPResult As New IP2Location.IPResult&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;If strIPAddress &lt;&gt; &quot;&quot; Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IP2Location.Component.IPDatabasePath = &quot;C:\\Program Files\\IP2Location\\Database\\IP-COUNTRY.SAMPLE.BIN&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;oIPResult = IP2Location.Component.IPQuery(strIPAddress)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Select Case oIPResult.Status&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Case &quot;OK&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;If oIPResult.CountryShort = &quot;JP&quot; Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#39; Visitor is from Japan&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#39; Show advertisement from JP&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Response.Write &quot;&amp;lt;img src=&quot;&quot;Japan.jpg&quot;&quot; border=&quot;&quot;0&quot;&quot; height=&quot;&quot;200&quot;&quot; width=&quot;&quot;100&quot;&quot; /&amp;gt;&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#39; Visitor is not from Japan&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#39; Show other advertisement&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Response.Write &quot;&amp;lt;img src=&quot;&quot;US.jpg&quot;&quot; border=&quot;&quot;0&quot;&quot; height=&quot;&quot;200&quot;&quot; width=&quot;&quot;100&quot;&quot; /&amp;gt;&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;End If&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Case &quot;EMPTY_IP_ADDRESS&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Response.Write(&quot;IP Address cannot be blank.&quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Case &quot;INVALID_IP_ADDRESS&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Response.Write(&quot;Invalid IP Address.&quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Case &quot;MISSING_FILE&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Response.Write(&quot;Invalid Database Path.&quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;End Select&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Response.Write(&quot;IP Address cannot be blank.&quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;End If&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Catch ex As Exception&lt;br /&gt;  &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Finally&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;oIPResult = Nothing&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;End Try&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Sample Codes in C# Webform&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;Using IP2Location;&lt;br /&gt;private void Query(string strIPAddress)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IPResult oIPResult = new IP2Location.IPResult();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (strIPAddress != &quot;&quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IP2Location.Component.IPDatabasePath = &quot;C:\\Program Files\\IP2Location\\Database\\IP-COUNTRY.SAMPLE.BIN&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;oIPResult = IP2Location.Component.IPQuery(strIPAddress);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;switch(oIPResult.Status.ToString())&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;case &quot;OK&quot;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (oIPResult.CountryShort == &quot;JP&quot;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Response.Write &quot;&amp;lt;img src=&quot;Japan.jpg&quot; border=&quot;\&quot; height=&quot;\&quot; width=&quot;\&quot; /&amp;gt;&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Response.Write &quot;&amp;lt;img src=&quot;US.jpg&quot; border=&quot;\&quot; height=&quot;\&quot; width=&quot;\&quot; /&amp;gt;&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;break;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;case &quot;EMPTY_IP_ADDRESS&quot;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Response.Write(&quot;IP Address cannot be blank.&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;break;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;case &quot;INVALID_IP_ADDRESS&quot;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Response.Write(&quot;Invalid IP Address.&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;break;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;case &quot;MISSING_FILE&quot;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Response.Write(&quot;Invalid Database Path.&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;break;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Response.Write(&quot;IP Address cannot be blank.&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;catch(Exception ex)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;finally&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;oIPResult = null;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;IP2Location also carries a wide variety of databases which are more advanced and has more types of data which could also be used to further narrow down your target audience. If you want to try out the online demo, you can go to &lt;a href=&quot;http://www.ip2location.com/demo.aspx&quot; target=&quot;_blank&quot;&gt;http://www.ip2location.com/demo.aspx&lt;/a&gt; and check it out.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuZm2n3uN0WguC6s57TbgsOnOUo3XaByJ1oKqT3PlwY-7DcMMSue_OAYou1zSoYqA6iLymFJaF8vUM6vChJ1wSXJqQ5jUbzKGlfO-vwxtUvUpoQJoRWlUJSbKANQJFLwx8FCdfKaccZMXV/s1600/IP2Location-DemoBox.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 186px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuZm2n3uN0WguC6s57TbgsOnOUo3XaByJ1oKqT3PlwY-7DcMMSue_OAYou1zSoYqA6iLymFJaF8vUM6vChJ1wSXJqQ5jUbzKGlfO-vwxtUvUpoQJoRWlUJSbKANQJFLwx8FCdfKaccZMXV/s320/IP2Location-DemoBox.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5405390748391307026&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://ipgeolocation.blogspot.com/2009/11/targeted-online-advertising-by-country.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvja8rd6lX7Sr7kRmsylXHLiI8BF5nN2KiJFnQjKQBfm6HKZzqgiahoNm9iHxsIuhFZ6C7BJpHWF0_Y_doGH1alRQyq8SWJqcmI155fILqsL2pcAvYCNmJNDz2XmpOty1xz2CMRR1C1QeW/s72-c/net_05.gif" height="72" width="72"/></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6697244717008085794.post-2606607164328527290</guid><pubDate>Thu, 19 Nov 2009 03:45:00 +0000</pubDate><atom:updated>2009-11-19T18:02:43.362-08:00</atom:updated><title>Optimize Online Advertising Campaign by Country using PHP and MySQL Database</title><description>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://www.ip2location.com/ip-country.aspx&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 109px; height: 104px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx3b8HvWVX0ZFx8sykRVGgAqaASG1WK2TtGO5We9QlSuNBfnoQdWtFxRSOx9a5Qg3pricgAhPPAK_T_zfCZp_4OjQsBN8JJuyuiHl2j37ydIo8PzVyd38EkxxpEU_Wbl3oj-ctOOSn8lJ9/s320/db1product.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5404945860109004546&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;div style=&quot;font-family: arial; font-size: 9pt;&quot;&gt;Let’s say you are coming from an English speaking country and you visit a website that shows you advertisements in a foreign language that you don’t understand. You would just ignore those advertisements like any normal person would. To the website owner, this is a lost opportunity to earn some money. That is why it is so vital to be able to match your web visitors with online advertisements that they will find relevant and useful. One way to do this is to show one set of advertisements for visitors from one country and then show another set to visitors from another country.&lt;br /&gt;&lt;br /&gt;In this tutorial, we will use the &lt;a href=&quot;http://www.ip2location.com/ip-country.aspx&quot; target=&quot;_blank&quot;&gt;IP2Location™IP-Country database&lt;/a&gt; to determine the country of origin for the web visitor just by checking the IP address. Instead of loading the full database with 50000+ records, we could simplify this tutorial with the assumption that only two different IP address ranges in the world. IP addresses of the range 0.0.0.0 - 126.255.255.255 originates from the United States. Meanwhile, IP addresses of the range 127.0.0.0 - 255.255.255.255 originates from Japan. Here we are creating a database called &quot;&lt;b&gt;IP2Location&lt;/b&gt;&quot; with a table called &quot;&lt;b&gt;IPCountry&lt;/b&gt;&quot; which contains our two IP address range records.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Step 1: Start the mysql command prompt. Run the 2 SQL command below to create the ‘IP2Location’ database and select it for use.&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt; mysql&gt; CREATE DATABASE IP2Location&lt;/b&gt;&lt;br /&gt;&lt;b&gt; mysql&gt; CONNECT IP2Location&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Step 2:  Next, run the SQL statement below to create the ‘IPCountry’ table.&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;mysql&gt; CREATE TABLE IPCountry&lt;br /&gt;--&gt; (&lt;br /&gt;--&gt; ipFROM DOUBLE NOT NULL,&lt;br /&gt;--&gt; ipTO DOUBLE NOT NULL,&lt;br /&gt;--&gt; countrySHORT VARCHAR(2) NOT NULL,&lt;br /&gt;--&gt; countryLONG VARCHAR(100) NOT NULL,&lt;br /&gt;--&gt; PRIMARY KEY(ipFROM, ipTO)&lt;br /&gt;--&gt; );&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Step 3: Run the SQL codes below to insert dummy data into the database.&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt; mysql&gt; INSERT INTO IPCountry VALUES (0, 2130706431,&#39;US&#39;,&#39;UNITED STATES&#39;);&lt;/b&gt;&lt;br /&gt;&lt;b&gt; mysql&gt; INSERT INTO IPCountry VALUES (2130706432, 4294967295,&#39;JP&#39;,&#39;JAPAN&#39;);&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The full version of &lt;b&gt;IP-Country database&lt;/b&gt; is available for subscription at $49/year from &lt;a href=&quot;http://www.ip2location.com/ip-country.aspx&quot; target=&quot;_blank&quot;&gt;http://www.ip2location.com/ip-country.aspx&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikHiI8mzkJeY-LFq6-v5rh-K_FF6NZET20loEMhz5vxWVllcJ0WSv8LK8b22h2eTqT5vgt3JF-MVMut6ZCqfAVqM84OO230Ylyh_JGALFcaPOUg_jOJl8QWgac8toFN4Cge8b5fCs2VV9U/s1600/IP2Location-DB1.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 212px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikHiI8mzkJeY-LFq6-v5rh-K_FF6NZET20loEMhz5vxWVllcJ0WSv8LK8b22h2eTqT5vgt3JF-MVMut6ZCqfAVqM84OO230Ylyh_JGALFcaPOUg_jOJl8QWgac8toFN4Cge8b5fCs2VV9U/s320/IP2Location-DB1.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5404963096993456786&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you have the full version of &lt;b&gt;IP2Location™IP-Country database&lt;/b&gt;, the import process is easier by using the &lt;b&gt;LOAD DATA&lt;/b&gt; feature available in MYSQL.&lt;br /&gt;&lt;br /&gt;PC:&lt;br /&gt;&lt;b&gt;mysql&gt; LOAD DATA INFILE &quot;/IPCountry.csv&quot; INTO TABLE IPCountry FIELDS TERMINATED BY &#39;,&#39; ENCLOSED BY &#39;&quot;&#39; LINES TERMINATED BY &#39;\n&#39;;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Linux/Unix:&lt;br /&gt;&lt;b&gt;mysql&gt; LOAD DATA INFILE &quot;/IPCountry.csv&quot; INTO TABLE IPCountry FIELDS TERMINATED BY &#39;,&#39; ENCLOSED BY &#39;&quot;&#39; LINES TERMINATED BY &#39;\r\n&#39;;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Below is a sample code in PHP which will show you how to use the data to optimize your online advertising campaign by country.&lt;br /&gt;&lt;br /&gt;&amp;lt;%php&lt;br /&gt;// Replace this MYSQL server variables with actual configuration&lt;br /&gt;$mysql_server = &quot;mysql_server.com&quot;;&lt;br /&gt;$mysql_user_name = &quot;UserName&quot;;&lt;br /&gt;$mysql_user_pass = &quot;Password&quot;;&lt;br /&gt;&lt;br /&gt;// Retrieve visitor IP address from server variable REMOTE_ADDR&lt;br /&gt;$ipaddress = getenv(REMOTE_ADDR);&lt;br /&gt;&lt;br /&gt;// Convert IP address to IP number for querying database&lt;br /&gt;$ipno = Dot2LongIP($ipaddress);&lt;br /&gt;&lt;br /&gt;// Connect to the database server&lt;br /&gt;$link = mysql_connect($mysql_server, $mysql_user_name, $mysql_user_pass) or die(&quot;Could not connect to MySQL database&quot;);&lt;br /&gt;&lt;br /&gt;// Connect to the IP2Location database&lt;br /&gt;mysql_select_db(&quot;IP2Location&quot;) or die(&quot;Could not select database&quot;);&lt;br /&gt;&lt;br /&gt;// SQL query string to match the recordset that the IP number fall between the valid range&lt;br /&gt;$query = &quot;SELECT * FROM IPCountry WHERE $ipno &lt;= ipTO AND $ipno&gt;=ipFROM&quot;;&lt;br /&gt;&lt;br /&gt;// Execute SQL query&lt;br /&gt;$result = mysql_query($query) or die(&quot;IP2Location Query Failed&quot;);&lt;br /&gt;&lt;br /&gt;// Retrieve the recordset (only one)&lt;br /&gt;$row = mysql_fetch_object($result);&lt;br /&gt;&lt;br /&gt;// Keep the country information into two different variables&lt;br /&gt;$countrySHORT = $row-&gt;countrySHORT;&lt;br /&gt;$countryLONG = $row-&gt;countryLONG;&lt;br /&gt;&lt;br /&gt;// Free recordset and close database connection&lt;br /&gt;mysql_free_result($result); mysql_close($link);&lt;br /&gt;&lt;br /&gt;if ($countrySHORT == &quot;JP&quot;)&lt;br /&gt;{&lt;br /&gt;// If the visitors are from JP, show advertisement from JP&lt;br /&gt;echo &quot;&amp;lt;img src=&quot;Japan.jpg&quot; border=&quot;0&quot; height=&quot;200&quot; width=&quot;100&quot;&amp;gt;&quot;;&lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt;// Otherwise, show other advertisement&lt;br /&gt;echo &quot;&amp;lt;img src=&quot;US.jpg&quot; border=&quot;0&quot; height=&quot;200&quot; width=&quot;100&quot;&amp;gt;&quot;;&lt;br /&gt;}&lt;br /&gt;exit;&lt;br /&gt;&lt;br /&gt;// Function to convert IP address (xxx.xxx.xxx.xxx) to IP number (0 to 256^4-1)&lt;br /&gt;function Dot2LongIP ($IPaddr) {&lt;br /&gt;if ($IPaddr == &quot;&quot;)&lt;br /&gt;{&lt;br /&gt; return 0;&lt;br /&gt;} else {&lt;br /&gt; $ips = split (&quot;\.&quot;, &quot;$IPaddr&quot;);&lt;br /&gt; return ($ips[3] + $ips[2] * 256 + $ips[1] * 256 * 256 + $ips[0] * 256 * 256 * 256);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;%&amp;gt;&lt;br /&gt;&lt;br /&gt;IP2Location also carries a wide variety of databases which are more advanced and has more types of data which could also be used to further narrow down your target audience. If you want to try out the online demo, you can go to &lt;a href=&quot;http://www.ip2location.com/demo.aspx&quot; target=&quot;_blank&quot;&gt;http://www.ip2location.com/demo.aspx&lt;/a&gt; and check it out.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4Fl-tXywGdVfCWHZcOG2dS4_8DEJwV92ScF4jV10Hlxku1Xa-73_DYpUoV0ggwsqPk3u36a7OpPk3Z-9gImGKeSqbMGEoHfzbGOibeBeyVCmJlNBqRf2ileauJb7c5UbW4VIpJiZboLDC/s1600/IP2Location-DemoBox.jpg&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 186px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4Fl-tXywGdVfCWHZcOG2dS4_8DEJwV92ScF4jV10Hlxku1Xa-73_DYpUoV0ggwsqPk3u36a7OpPk3Z-9gImGKeSqbMGEoHfzbGOibeBeyVCmJlNBqRf2ileauJb7c5UbW4VIpJiZboLDC/s320/IP2Location-DemoBox.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5405662904503523218&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://ipgeolocation.blogspot.com/2009/11/optimize-online-advertising-campaign-by.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx3b8HvWVX0ZFx8sykRVGgAqaASG1WK2TtGO5We9QlSuNBfnoQdWtFxRSOx9a5Qg3pricgAhPPAK_T_zfCZp_4OjQsBN8JJuyuiHl2j37ydIo8PzVyd38EkxxpEU_Wbl3oj-ctOOSn8lJ9/s72-c/db1product.gif" height="72" width="72"/></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6697244717008085794.post-1077414936507851176</guid><pubDate>Thu, 19 Nov 2009 03:05:00 +0000</pubDate><atom:updated>2009-11-18T19:27:39.206-08:00</atom:updated><title>Niche Advertising by Country using ASP and MS-SQL Database</title><description>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://www.ip2location.com/ip-country.aspx&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 109px; height: 104px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx3b8HvWVX0ZFx8sykRVGgAqaASG1WK2TtGO5We9QlSuNBfnoQdWtFxRSOx9a5Qg3pricgAhPPAK_T_zfCZp_4OjQsBN8JJuyuiHl2j37ydIo8PzVyd38EkxxpEU_Wbl3oj-ctOOSn8lJ9/s320/db1product.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5404945860109004546&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;div style=&quot;font-family: arial; font-size: 9pt;&quot;&gt;Online advertisements are a big revenue earner for most websites. So it is no wonder that most of them employ ways to detect their web visitor’s country so that the advertisements can be targeted to its niche audience. By doing so, the probability of a sale from the online advertisement increases tremendously as the targeted audience would most likely find that advertisement to be relevant and maybe even helpful.&lt;br /&gt;&lt;br /&gt;In this tutorial, we will use the &lt;a href=&quot;http://www.ip2location.com/ip-country.aspx&quot; target=&quot;_blank&quot;&gt;IP2Location™IP-Country database&lt;/a&gt; to determine the country of origin for the web visitor just by checking the IP address. Instead of loading the full database with 50000+ records, we could simplify this tutorial with the assumption that only two different IP address ranges in the world. IP addresses of the range 0.0.0.0 - 126.255.255.255 originates from the United States. Meanwhile, IP addresses of the range 127.0.0.0 - 255.255.255.255 originates from Japan. Here we are creating a database called &quot;&lt;b&gt;IP2Location&lt;/b&gt;&quot; with a table called &quot;&lt;b&gt;IPCountry&lt;/b&gt;&quot; which contains our two IP address range records.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Step 1: Start Microsoft SQL Server Management Studio.&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;Now, login to your database instance and then click on the New Query button. Copy the 2 lines of SQL codes below into the query window and press Execute to run the codes. This will create the ‘&lt;b&gt;IP2Location&lt;/b&gt;’ database and select it for use.&lt;br /&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:blue&#39;&gt;CREATE&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt; &lt;span style=&#39;color:blue&#39;&gt;DATABASE&lt;/span&gt; IP2Location&lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:blue&#39;&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:blue&#39;&gt;USE&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt; IP2Location&lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:blue&#39;&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhysrXjLbqxL4qJI0Eu1h0b24tsNCGk1jeGW7mptWv4AJLmdu3Bv35sYWc8Fm47xWJKtStP-huFghJrjM-spxlotwU0qDsVMnk2nLKuogfWwdBGP-44yvRpaZRWW0fQ86bkxR_3jhDpyTp9/s1600/IP2Location-MSSQLStep1.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 178px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhysrXjLbqxL4qJI0Eu1h0b24tsNCGk1jeGW7mptWv4AJLmdu3Bv35sYWc8Fm47xWJKtStP-huFghJrjM-spxlotwU0qDsVMnk2nLKuogfWwdBGP-44yvRpaZRWW0fQ86bkxR_3jhDpyTp9/s320/IP2Location-MSSQLStep1.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5404960851315977106&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Step 2:  Next, run the SQL statement below to create the ‘&lt;b&gt;IPCountry&lt;/b&gt;’ table.&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:blue&#39;&gt;CREATE&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;&#39;&gt; &lt;span style=&#39;color:blue&#39;&gt;TABLE&lt;/span&gt;[dbo]&lt;span style=&#39;color:gray&#39;&gt;.&lt;/span&gt;[IPCountry]&lt;span style=&#39;color:blue&#39;&gt; &lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;(&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt;[ipFROM] [float] &lt;span style=&#39;color:gray&#39;&gt;NOT&lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;NULL&lt;/span&gt; &lt;span style=&#39;color:gray&#39;&gt;,&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt;[ipTO] [float] &lt;span style=&#39;color:gray&#39;&gt;NOT&lt;/span&gt; &lt;span style=&#39;color:gray&#39;&gt;NULL&lt;/span&gt; &lt;span style=&#39;color:gray&#39;&gt;,&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt;[countrySHORT] [nvarchar]&lt;span style=&#39;color:blue&#39;&gt; &lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;(&lt;/span&gt;2&lt;span style=&#39;color:gray&#39;&gt;),&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt;[countryLONG] [nvarchar]&lt;span style=&#39;color:blue&#39;&gt; &lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;(&lt;/span&gt;64&lt;span style=&#39;color:gray&#39;&gt;)&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:gray&#39;&gt;)&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt; &lt;span style=&#39;color:blue&#39;&gt;ON&lt;/span&gt; [PRIMARY] &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:blue&#39;&gt;GO&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAm4dfjhPHrgnkPaw9tML5HC9ce7YGfWXG0tOqrwmAdt7zBik8vh3BSljYtAi9Qe7L7N-PT83IM0sJ_gu0WkKi7v5_hgfL1qsp9E5RNvUQb-8eiOxYcN8TzSnQ3xy0NhD9p3dMFtU7JPfU/s1600/IP2Location-MSSQLStep2.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 241px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAm4dfjhPHrgnkPaw9tML5HC9ce7YGfWXG0tOqrwmAdt7zBik8vh3BSljYtAi9Qe7L7N-PT83IM0sJ_gu0WkKi7v5_hgfL1qsp9E5RNvUQb-8eiOxYcN8TzSnQ3xy0NhD9p3dMFtU7JPfU/s320/IP2Location-MSSQLStep2.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5404961086167914882&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Step 3: Run the SQL codes below to insert dummy data into the database.&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:blue&#39;&gt;INSERT&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;&#39;&gt; &lt;span style=&#39;color:blue&#39;&gt;INTO&lt;/span&gt; IPCountry &lt;span style=&#39;color:blue&#39;&gt;VALUES &lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;(&lt;/span&gt;0&lt;span style=&#39;color:gray&#39;&gt;,&lt;/span&gt; 2130706431&lt;span style=&#39;color:gray&#39;&gt;,&lt;/span&gt;&lt;span style=&#39;color:red&#39;&gt;&#39;US&#39;&lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;,&lt;/span&gt;&lt;span style=&#39;color:red&#39;&gt;&#39;UNITED STATES&#39;&lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;; color:blue&#39;&gt;INSERT&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;&#39;&gt; &lt;span style=&#39;color:blue&#39;&gt;INTO&lt;/span&gt; IPCountry &lt;span style=&#39;color:blue&#39;&gt;VALUES &lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;(&lt;/span&gt;2130706432&lt;span style=&#39;color:gray&#39;&gt;,&lt;/span&gt; 4294967295&lt;span style=&#39;color:gray&#39;&gt;,&lt;/span&gt;&lt;span style=&#39;color:red&#39;&gt;&#39;JP&#39;&lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;,&lt;/span&gt;&lt;span style=&#39;color:red&#39;&gt;&#39;JAPAN&#39;&lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_O7AiGqWR_VsN1xXUDBWo_37wgZGs2QbtLjE6qjCqAab8KtHk8DRO1QLCMbM1UvXIIB2jF8iW0g7t_kPz2INZc4F361XiRD4wZv3Pmo2uKrpzUX_LYKR2ZiH2lmJbNokhbm6pJFKldWPA/s1600/IP2Location-MSSQLStep3.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 241px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_O7AiGqWR_VsN1xXUDBWo_37wgZGs2QbtLjE6qjCqAab8KtHk8DRO1QLCMbM1UvXIIB2jF8iW0g7t_kPz2INZc4F361XiRD4wZv3Pmo2uKrpzUX_LYKR2ZiH2lmJbNokhbm6pJFKldWPA/s320/IP2Location-MSSQLStep3.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5404961221778900898&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The full version of &lt;b&gt;IP-Country database&lt;/b&gt; is available for subscription at $49/year from &lt;a href=&quot;http://www.ip2location.com/ip-country.aspx&quot; target=&quot;_blank&quot;&gt;http://www.ip2location.com/ip-country.aspx&lt;/a&gt;. If you have the full version of &lt;b&gt;IP2Location™IP-Country database&lt;/b&gt;, import process is easy done by using the &lt;b&gt;Database Transformation Service (DTS)&lt;/b&gt; in MS-SQL.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikHiI8mzkJeY-LFq6-v5rh-K_FF6NZET20loEMhz5vxWVllcJ0WSv8LK8b22h2eTqT5vgt3JF-MVMut6ZCqfAVqM84OO230Ylyh_JGALFcaPOUg_jOJl8QWgac8toFN4Cge8b5fCs2VV9U/s1600/IP2Location-DB1.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 212px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikHiI8mzkJeY-LFq6-v5rh-K_FF6NZET20loEMhz5vxWVllcJ0WSv8LK8b22h2eTqT5vgt3JF-MVMut6ZCqfAVqM84OO230Ylyh_JGALFcaPOUg_jOJl8QWgac8toFN4Cge8b5fCs2VV9U/s320/IP2Location-DB1.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5404963096993456786&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In your ASP page, you will need to put in the codes below.&lt;br /&gt;&lt;br /&gt;&amp;lt;&amp;#37;&lt;br /&gt;  Dim conn, myDSN, mySQL, rs&lt;br /&gt; &lt;br /&gt;  &#39; SQL database connection. NOTE: Replace servername, username and password to your own values.&lt;br /&gt;  Set conn = Server.CreateObject(&quot;ADODB.Connection&quot;)&lt;br /&gt; &lt;br&gt; myDSN=&quot;DRIVER={SQLServer};SERVER=servername;UID=username;PWD=password;DATABASE=IP2Location&quot;&lt;br /&gt; &lt;br /&gt;  conn.open myDNS&lt;br /&gt; &lt;br /&gt;  &#39; retrieve visitor IP address and translate it to IP address number&lt;br /&gt;  IPno = Dot2LongIP(Request.ServerVariables(&quot;REMOTE_ADDR&quot;))&lt;br /&gt; &lt;br /&gt;  &#39; SQL query to lookup valid range of IP address&lt;br /&gt;  mySQL = &quot;SELECT countrySHORT FROM IPCountry WHERE &quot; &amp; IPno &amp; &quot; BETWEEN ipFROM AND ipTO&quot;&lt;br /&gt; &lt;br /&gt;  Set rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)&lt;br /&gt;  rs.open mySQL, conn&lt;br /&gt; &lt;br /&gt;  &#39; assign country name for reference&lt;br /&gt;  countryName = rs(&quot;countrySHORT&quot;)&lt;br /&gt; &lt;br /&gt;  &#39; close and free connections&lt;br /&gt;  rs.close&lt;br /&gt;  conn.close&lt;br /&gt;  set rs = nothing&lt;br /&gt;  Set conn = nothing  &lt;br /&gt;&lt;br /&gt;If CountryName = &quot;JP&quot; Then&lt;br /&gt;&#39; Visitor is from Japan&lt;br /&gt;&#39; Show advertisement from Japan&lt;br /&gt;response.write &quot;&amp;lt;img src=&quot;&quot;Japan.jpg&quot;&quot; border=&quot;&quot;0&quot;&quot; height=&quot;&quot;200&quot;&quot; width=&quot;&quot;100&quot;&quot;&amp;gt;&quot;&lt;br /&gt;Else&lt;br /&gt;&#39; Visitor is not from Japan&lt;br /&gt;&#39; Show other advertisement&lt;br /&gt;response.write &quot;&amp;lt;img src=&quot;&quot;US.jpg&quot;&quot; border=&quot;&quot;0&quot;&quot; height=&quot;&quot;200&quot;&quot; width=&quot;&quot;100&quot;&quot;&amp;gt;&quot;&lt;br /&gt;End If&lt;br /&gt;%&amp;gt;&lt;br /&gt;&lt;br /&gt;Function Dot2LongIP (ByVal DottedIP)&lt;br /&gt;Dim i, pos&lt;br /&gt;Dim PrevPos, num&lt;br /&gt;If DottedIP = &quot;&quot; Then&lt;br /&gt;Dot2LongIP = 0&lt;br /&gt;Else&lt;br /&gt;For i = 1 To 4&lt;br /&gt;pos = InStr(PrevPos + 1, DottedIP, &quot;.&quot;, 1)&lt;br /&gt;If i = 4 Then&lt;br /&gt;pos = Len(DottedIP) + 1&lt;br /&gt;End If&lt;br /&gt;num = Int(Mid(DottedIP, PrevPos + 1, pos - PrevPos - 1))&lt;br /&gt;PrevPos = pos&lt;br /&gt;Dot2LongIP = ((num Mod 256) * (256 ^ (4 - i))) + Dot2LongIP&lt;br /&gt;Next&lt;br /&gt;End If&lt;br /&gt;End Function&lt;br /&gt;&amp;#37;&amp;gt;&lt;br /&gt;&lt;br /&gt;IP2Location also carries a wide variety of databases which are more advanced and has more types of data which could also be used to further narrow down your target audience. You can try out the online demo at &lt;a href=&quot;http://www.ip2location.com/demo.aspx&quot; target=&quot;_blank&quot;&gt;http://www.ip2location.com/demo.aspx&lt;/a&gt; and see for yourself what you are missing.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMhNuJYcEWelkddaeO-JmYkk84i-2JNQbOzm09F13WlffdebUcF3xZfttogc_AKLMiosNkrmX_pEW9MClYwZ3HEODzce5yRZJZ1h_8sPPlj3_C9s2tzlhSSAVTgyP1LPf68O71dbvl1mJr/s1600/IP2Location-DemoBox.jpg&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 186px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMhNuJYcEWelkddaeO-JmYkk84i-2JNQbOzm09F13WlffdebUcF3xZfttogc_AKLMiosNkrmX_pEW9MClYwZ3HEODzce5yRZJZ1h_8sPPlj3_C9s2tzlhSSAVTgyP1LPf68O71dbvl1mJr/s320/IP2Location-DemoBox.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5405648070898977090&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://ipgeolocation.blogspot.com/2009/11/niche-advertising-by-country-using-asp.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx3b8HvWVX0ZFx8sykRVGgAqaASG1WK2TtGO5We9QlSuNBfnoQdWtFxRSOx9a5Qg3pricgAhPPAK_T_zfCZp_4OjQsBN8JJuyuiHl2j37ydIo8PzVyd38EkxxpEU_Wbl3oj-ctOOSn8lJ9/s72-c/db1product.gif" height="72" width="72"/></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6697244717008085794.post-6280967388727643283</guid><pubDate>Wed, 18 Nov 2009 10:29:00 +0000</pubDate><atom:updated>2009-11-18T19:23:03.120-08:00</atom:updated><title>Display Advertisement by Country using ASP and COM Technology</title><description>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://www.ip2location.com/ip2location-activex.aspx&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 109px; height: 104px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiT8Tvl48CNANIobALZwkW9doUWGnHTdHP-iBNCl4FKSKU1sAC0pwZSHhz82cOQrx3c5r9yYmV9vRa25pW5hdT5hSkpw1O_QlUyFejOMYerBMax2Ay5W40pztOLK-egoN-X7nA5Gq-RKT27/s320/activexproduct.gif&quot; alt=&quot;IP2Location™ ActiveX/COM DLL&quot; id=&quot;BLOGGER_PHOTO_ID_5405390865707546754&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;div style=&quot;font-family: arial; font-size: 9pt;&quot;&gt;Online advertisements these days are now raking in the big bucks due to the simple fact that it is now possible to display different advertisements to web visitors from different countries.  By showing an advertisement that is relevant to the web visitor, there is a higher chance that it will attract the attention of the web visitor which tends to lead to a sale.&lt;br /&gt;&lt;br /&gt;In this example, we use a fully functional &lt;b&gt;IP2Location™ActiveX component&lt;/b&gt; available at &lt;a href=&quot;http://www.ip2location.com/ip2location-country.zip&quot; target=&quot;_blank&quot;&gt;http://www.ip2location.com/ip2location-country.zip&lt;/a&gt; to determine the visitor’s country by their IP address. Since the component is unregistered, there is a 5-second delay in every query.&lt;br /&gt;&lt;br /&gt;To avoid any delays in the query, you can consider purchasing the &lt;a href=&quot;http://www.ip2location.com/ip2location-activex.aspx&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;IP2Location ActiveX/COM Component Version 3.0&lt;/b&gt;&lt;/a&gt;, which is a software development component and data solution for Windows®. You can tailor the content of your site dynamically based on visitor’s country, region, city, latitude, longitude, ZIP code, ISP, domain name, time zone, connection speed, IDD code, area code, weather station code and weather station name.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiahOiYL497lbHcvPDb-x7B_Lt95bNNqzXWoChYzSZZdzYsg4AxfXVDptORIgO3baSgX3k32SEEMKC5G58TeU2ZK8NBqXnA17lp61TNy5yaHgPb3Klamk-faIr0FY6I_SOpJpVahXF4ZBql/s1600/IP2Location-ActiveXComponent.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 218px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiahOiYL497lbHcvPDb-x7B_Lt95bNNqzXWoChYzSZZdzYsg4AxfXVDptORIgO3baSgX3k32SEEMKC5G58TeU2ZK8NBqXnA17lp61TNy5yaHgPb3Klamk-faIr0FY6I_SOpJpVahXF4ZBql/s320/IP2Location-ActiveXComponent.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5405391140316495986&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Copy the ActiveX component to the IIS web server. Then run the following command in DOS prompt.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;        C:\&gt; regsvr32 ip2location.dll&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Below is the sample code in ASP which will display advertisement by country.&lt;br /&gt;&lt;br /&gt;&amp;lt;%      &#39; Create server-side object      Set ipObj = Server.CreateObject(&quot;IP2Location.Country&quot;)        &#39; Initialize IP2Location object      If ipObj.Initialize(&quot;demo&quot;) &lt;&gt; &quot;OK&quot; Then&lt;br /&gt;response.write &quot;IP2Location Initialization Failed.&quot;&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;&#39; Get visitor&#39;s IP address&lt;br /&gt;IPaddr = Request.ServerVariables(&quot;REMOTE_ADDR&quot;)&lt;br /&gt;&lt;br /&gt;&#39; Detect visitor&#39;s country of origin by IP address&lt;br /&gt;CountryName = ipObj.LookUpShortName(IPaddr)&lt;br /&gt;&lt;br /&gt;&#39; Free IP2Location object&lt;br /&gt;Set ipObj = nothing&lt;br /&gt;&lt;br /&gt;If CountryName = &quot;JP&quot; Then&lt;br /&gt;&#39; Visitor is from Japan&lt;br /&gt;&#39; Show advertisement from Japan&lt;br /&gt;response.write &quot;&amp;lt;img src=&quot;&quot;Japan.jpg&quot;&quot; border=&quot;&quot;0&quot;&quot; height=&quot;&quot;200&quot;&quot; width=&quot;&quot;100&quot;&quot;&amp;gt;&quot;&lt;br /&gt;Else&lt;br /&gt;&#39; Visitor is not from Japan&lt;br /&gt;&#39; Show other advertisement&lt;br /&gt;response.write &quot;&amp;lt;img src=&quot;&quot;US.jpg&quot;&quot; border=&quot;&quot;0&quot;&quot; height=&quot;&quot;200&quot;&quot; width=&quot;&quot;100&quot;&quot;&amp;gt;&quot;&lt;br /&gt;End If&lt;br /&gt;%&amp;gt;&lt;br /&gt;&lt;br /&gt;IP2Location also carries a wide variety of databases which are more advanced and has more types of data which could also be used to further narrow down your target audience. If you want to try out the online demo, you can go to &lt;a href=&quot;http://www.ip2location.com/demo.aspx&quot; target=&quot;_blank&quot;&gt;http://www.ip2location.com/demo.aspx&lt;/a&gt; and check it out.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuZm2n3uN0WguC6s57TbgsOnOUo3XaByJ1oKqT3PlwY-7DcMMSue_OAYou1zSoYqA6iLymFJaF8vUM6vChJ1wSXJqQ5jUbzKGlfO-vwxtUvUpoQJoRWlUJSbKANQJFLwx8FCdfKaccZMXV/s1600/IP2Location-DemoBox.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 186px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuZm2n3uN0WguC6s57TbgsOnOUo3XaByJ1oKqT3PlwY-7DcMMSue_OAYou1zSoYqA6iLymFJaF8vUM6vChJ1wSXJqQ5jUbzKGlfO-vwxtUvUpoQJoRWlUJSbKANQJFLwx8FCdfKaccZMXV/s320/IP2Location-DemoBox.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5405390748391307026&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://ipgeolocation.blogspot.com/2009/11/display-advertisement-by-country-using.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiT8Tvl48CNANIobALZwkW9doUWGnHTdHP-iBNCl4FKSKU1sAC0pwZSHhz82cOQrx3c5r9yYmV9vRa25pW5hdT5hSkpw1O_QlUyFejOMYerBMax2Ay5W40pztOLK-egoN-X7nA5Gq-RKT27/s72-c/activexproduct.gif" height="72" width="72"/></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6697244717008085794.post-9160758583801355177</guid><pubDate>Wed, 18 Nov 2009 06:48:00 +0000</pubDate><atom:updated>2009-11-17T23:27:57.314-08:00</atom:updated><title>Displaying the Currency Type by Visitor&#39;s Country using PHP and MYSQL Database</title><description>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://www.ip2location.com/ip-country.aspx&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 109px; height: 104px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx3b8HvWVX0ZFx8sykRVGgAqaASG1WK2TtGO5We9QlSuNBfnoQdWtFxRSOx9a5Qg3pricgAhPPAK_T_zfCZp_4OjQsBN8JJuyuiHl2j37ydIo8PzVyd38EkxxpEU_Wbl3oj-ctOOSn8lJ9/s320/db1product.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5404945860109004546&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;div style=&quot;font-family: arial; font-size: 9pt;&quot;&gt;More and more companies have started to take their businesses online which bring about significant cost reductions as opposed to traditional businesses. In addition, there is now an opportunity to take your products or services and market them to a larger audience of prospective customers from all over the world.  To become a successful global player, online business owners need automatic IP-Country detection for localized currency type which will help them to boost their online sales by removing the foreign currency conversion barrier and converting their website visitors into buyers.&lt;br /&gt;&lt;br /&gt;In this tutorial, we will use the &lt;a href=&quot;http://www.ip2location.com/ip-country.aspx&quot; target=&quot;_blank&quot;&gt;IP2Location™IP-Country database&lt;/a&gt; to determine the country of origin for the web visitor just by checking the IP address. Instead of loading the full database with 50000+ records, we could simplify this tutorial with the assumption that only two different IP address ranges in the world. IP addresses of the range 0.0.0.0 - 126.255.255.255 originates from the United States. Meanwhile, IP addresses of the range 127.0.0.0 - 255.255.255.255 originates from Japan. Here we are creating a database called &quot;&lt;b&gt;IP2Location&lt;/b&gt;&quot; with a table called &quot;&lt;b&gt;IPCountry&lt;/b&gt;&quot; which contains our two IP address range records.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Step 1: Start the mysql command prompt. Run the 2 SQL command below to create the ‘IP2Location’ database and select it for use&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt; mysql&gt; CREATE DATABASE IP2Location ;&lt;/b&gt;&lt;br /&gt;&lt;b&gt; mysql&gt; CONNECT IP2Location;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Step 2:  Next, run the SQL statement below to create the ‘IPCountry’ table&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;mysql&gt; CREATE TABLE IPCountry&lt;br /&gt;--&gt; (&lt;br /&gt;--&gt; ipFROM DOUBLE NOT NULL,&lt;br /&gt;--&gt; ipTO DOUBLE NOT NULL,&lt;br /&gt;--&gt; countrySHORT VARCHAR(2) NOT NULL,&lt;br /&gt;--&gt; countryLONG VARCHAR(100) NOT NULL,&lt;br /&gt;--&gt; PRIMARY KEY(ipFROM, ipTO)&lt;br /&gt;--&gt; );&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Step 3: Run the SQL codes below to insert dummy data into the database&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt; mysql&gt; INSERT INTO IPCountry VALUES (0, 2130706431,&#39;US&#39;,&#39;UNITED STATES&#39;);&lt;/b&gt;&lt;br /&gt;&lt;b&gt; mysql&gt; INSERT INTO IPCountry VALUES (2130706432, 4294967295,&#39;JP&#39;,&#39;JAPAN&#39;);&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The full version of IP-Country database is available for subscription at $49/year from &lt;a href=&quot;http://www.ip2location.com/ip-country.aspx&quot; target=&quot;_blank&quot;&gt;http://www.ip2location.com/ip-country.aspx&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikHiI8mzkJeY-LFq6-v5rh-K_FF6NZET20loEMhz5vxWVllcJ0WSv8LK8b22h2eTqT5vgt3JF-MVMut6ZCqfAVqM84OO230Ylyh_JGALFcaPOUg_jOJl8QWgac8toFN4Cge8b5fCs2VV9U/s1600/IP2Location-DB1.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 212px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikHiI8mzkJeY-LFq6-v5rh-K_FF6NZET20loEMhz5vxWVllcJ0WSv8LK8b22h2eTqT5vgt3JF-MVMut6ZCqfAVqM84OO230Ylyh_JGALFcaPOUg_jOJl8QWgac8toFN4Cge8b5fCs2VV9U/s320/IP2Location-DB1.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5404963096993456786&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you have the full version of &lt;a href=&quot;http://www.ip2location.com/ip-country.aspx&quot; target=&quot;_blank&quot;&gt;IP2Location™ IP-Country database&lt;/a&gt;, the import process is easier by using the &lt;b&gt;LOAD DATA&lt;/b&gt; feature available in MYSQL.&lt;br /&gt;&lt;br /&gt;PC:&lt;br /&gt;&lt;b&gt;mysql&gt; LOAD DATA INFILE &quot;/IPCountry.csv&quot; INTO TABLE IPCountry FIELDS TERMINATED BY &#39;,&#39; ENCLOSED BY &#39;&quot;&#39; LINES TERMINATED BY &#39;\n&#39;;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Linux/Unix:&lt;br /&gt;&lt;b&gt;mysql&gt; LOAD DATA INFILE &quot;/IPCountry.csv&quot; INTO TABLE IPCountry FIELDS TERMINATED BY &#39;,&#39; ENCLOSED BY &#39;&quot;&#39; LINES TERMINATED BY &#39;\r\n&#39;;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Step 4: Run the SQL statement below to create the &#39;Countries&#39; table&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;mysql&gt; CREATE TABLE Countries &lt;br /&gt;--&gt; (&lt;br /&gt;--&gt; TLD VARCHAR(2) NOT NULL,&lt;br /&gt;--&gt; Country VARHCAR(100) NOT NULL,&lt;br /&gt;--&gt; FIPS104 VARCHAR(2) NOT NULL,&lt;br /&gt;--&gt; ISO2 VARCHAR(2) NOT NULL,&lt;br /&gt;--&gt; ISO3 VARCHAR(3) NOT NULL,&lt;br /&gt;--&gt; ISONo INT NOT NULL,&lt;br /&gt;--&gt; Capital VARCHAR(100) NOT NULL,&lt;br /&gt;--&gt; Region VARCHAR(100) NOT NULL,&lt;br /&gt;--&gt; Currency VARCHAR(50) NOT NULL,&lt;br /&gt;--&gt; CurrencyCode VARCHAR(3) NOT NULL,&lt;br /&gt;--&gt; Population DOUBLE NOT NULL,&lt;br /&gt;--&gt; );&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The country information is available for FREE at &lt;a href=&quot;http://www.ip2location.com/countryinformation.aspx&quot; target=&quot;_blank&quot;&gt;http://www.ip2location.com/countryinformation.aspx&lt;/a&gt; . It consists of the top level domain (TLD), ISO-3166, country, capital, region, currency, currency code and population. Download and load the data into your database. It&#39;s available in several formats such as Comma-delimited ASCII, Microsoft® Access &amp;amp; Microsoft® Excel. The import process is same as the IP-Country database by using the LOAD DATA feature available in MYSQL.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEAyuqDTYCUzlrETFwuxHPhP9lsz3MnyY_MzRaKzG9eBDhyvFKz-1MNL2nNXdzUFFNyNpxyxumnn3ALcwPlNVafp7bH4rTVF13N9HIQLG5kUGmHSyjDZ7RxZuUFaG4fudmQZefXC6FfK2x/s1600/IP2Location-CountryInformation.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 208px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEAyuqDTYCUzlrETFwuxHPhP9lsz3MnyY_MzRaKzG9eBDhyvFKz-1MNL2nNXdzUFFNyNpxyxumnn3ALcwPlNVafp7bH4rTVF13N9HIQLG5kUGmHSyjDZ7RxZuUFaG4fudmQZefXC6FfK2x/s320/IP2Location-CountryInformation.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5404961908493213058&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can use the SQL statement below to import the country information into the database.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;mysql&gt; LOAD DATA INFILE &quot;/Countries.csv&quot; INTO TABLE Countries FIELDS TERMINATED BY &#39;,&#39; ENCLOSED BY &#39;&quot;&#39; LINES TERMINATED BY &#39;\r&#39;;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Below is a sample code in PHP which will show you how to use the data to determine the correct currency to display the pricing.&lt;br /&gt;&lt;br /&gt;&amp;lt;?php &lt;br /&gt;// Replace this MYSQL server variables with actual configuration &lt;br /&gt;$mysql_server = &quot;mysql_server.com&quot;; &lt;br /&gt;$mysql_user_name = &quot;UserName&quot;; &lt;br /&gt;$mysql_user_pass = &quot;Password&quot;; &lt;br /&gt;&lt;br /&gt;// Retrieve visitor IP address from server variable REMOTE_ADDR &lt;br /&gt;$ipaddress = getenv(REMOTE_ADDR); &lt;br /&gt;&lt;br /&gt;// Convert IP address to IP number for querying database&lt;br /&gt;$ipno = Dot2LongIP($ipaddress); &lt;br /&gt;&lt;br /&gt;// Connect to the database server &lt;br /&gt;$link = mysql_connect($mysql_server, $mysql_user_name, $mysql_user_pass) or die(&quot;Could not connect to MySQL database&quot;); &lt;br /&gt;&lt;br /&gt;// Connect to the IP2Location database &lt;br /&gt;mysql_select_db(&quot;IP2Location&quot;) or die(&quot;Could not select database&quot;); &lt;br /&gt;&lt;br /&gt;// SQL query string to match the recordset that the IP number fall between the valid range &lt;br /&gt;$query = &quot;SELECT * FROM IPCountry WHERE $ipno &lt;= ipTO AND $ipno&gt;=ipFROM&quot;; &lt;br /&gt;&lt;br /&gt;// Execute SQL query &lt;br /&gt;$result = mysql_query($query) or die(&quot;IP2Location Query Failed&quot;); &lt;br /&gt;&lt;br /&gt;// Retrieve the recordset (only one) &lt;br /&gt;$row = mysql_fetch_object($result); &lt;br /&gt;&lt;br /&gt;// Keep the country information into two different variables &lt;br /&gt;$countrySHORT = $row-&gt;countrySHORT; &lt;br /&gt;$countryLONG = $row-&gt;countryLONG; &lt;br /&gt;// SQL query string to match the recordset that the TLD with Country Short Name &lt;br /&gt;$query = &quot;SELECT * FROM Countries WHERE TLD=&#39;$countrySHORT&#39;; &lt;br /&gt;&lt;br /&gt;// Execute SQL query &lt;br /&gt;$result = mysql_query($query) or die(&quot;IP2Location Query Failed&quot;); &lt;br /&gt;&lt;br /&gt;// Retrieve the recordset (only one) &lt;br /&gt;$row = mysql_fetch_object($result); &lt;br /&gt;&lt;br /&gt;// Keep the Currency Code in a variable &lt;br /&gt;$currencyCode = $row-&gt;CurrencyCode; &lt;br /&gt;&lt;br /&gt;// Free recordset and close database connection &lt;br /&gt;mysql_free_result($result); mysql_close($link); &lt;br /&gt;&lt;br /&gt;// If the visitors are from JP&lt;br /&gt;if ($countrySHORT == &quot;JP&quot;) &lt;br /&gt;{&lt;br /&gt;  //Print Price: YEN 120.00&lt;br /&gt;  echo “Price: $currentCode 120.00”;&lt;br /&gt;} &lt;br /&gt;else &lt;br /&gt;{ &lt;br /&gt;  // Otherwise&lt;br /&gt;  //Print USD 1.00&lt;br /&gt;  echo “Price: $currentCode 1.00”;&lt;br /&gt;}&lt;br /&gt;exit;&lt;br /&gt;&lt;br /&gt;// Function to convert IP address (xxx.xxx.xxx.xxx) to IP number (0 to 256^4-1) &lt;br /&gt;function Dot2LongIP ($IPaddr) { &lt;br /&gt; if ($IPaddr == &quot;&quot;) &lt;br /&gt; {&lt;br /&gt;   return 0;&lt;br /&gt; } else { &lt;br /&gt;   $ips = split (&quot;\.&quot;, &quot;$IPaddr&quot;); &lt;br /&gt;   return ($ips[3] + $ips[2] * 256 + $ips[1] * 256 * 256 + $ips[0] * 256 * 256 * 256); &lt;br /&gt; }&lt;br /&gt;} &lt;br /&gt;?&gt; &lt;br /&gt;&lt;br /&gt;What you have seen here today is just the tip of the iceberg of what you can do with the &lt;a href=&quot;http://www.ip2location.com/ip-country.aspx&quot; taget=&quot;_blank&quot;&gt;IP2Location™IP-Country database&lt;/a&gt;. You could even pair the code above with a forex service to get a real-time conversion rate for the currencies thus making your currency conversions even more up-to-date. Now that you have realized the power of the &lt;a href=&quot;http://www.ip2location.com/ip-country.aspx&quot; taget=&quot;_blank&quot;&gt;IP2Location™IP-Country database&lt;/a&gt;, you will benefit even more from the more advanced databases available from IP2Location. You can try out the online demo at &lt;a href=&quot;http://www.ip2location.com/demo.aspx&quot; target=&quot;_blank&quot;&gt;http://www.ip2location.com/demo.aspx&lt;/a&gt; and see for yourself what you are missing.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-T9BFlyfTbQS5BI_DhKnmeaO6jiOoi1hOqc7TBCCGZaMrA3-KZvZOcuo4lnQ1JF6-LZz-nd5gIe3mVLjdrtY8EMPauLOmXYg1ZFMYFULx2HcSMzqdWV_bKsInzRD0qhctT9xSYpSI7Ue8/s1600/IP2Location-LiveDemo.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 215px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-T9BFlyfTbQS5BI_DhKnmeaO6jiOoi1hOqc7TBCCGZaMrA3-KZvZOcuo4lnQ1JF6-LZz-nd5gIe3mVLjdrtY8EMPauLOmXYg1ZFMYFULx2HcSMzqdWV_bKsInzRD0qhctT9xSYpSI7Ue8/s320/IP2Location-LiveDemo.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5404962196276015746&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://ipgeolocation.blogspot.com/2009/11/displaying-currency-type-by-visitors.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx3b8HvWVX0ZFx8sykRVGgAqaASG1WK2TtGO5We9QlSuNBfnoQdWtFxRSOx9a5Qg3pricgAhPPAK_T_zfCZp_4OjQsBN8JJuyuiHl2j37ydIo8PzVyd38EkxxpEU_Wbl3oj-ctOOSn8lJ9/s72-c/db1product.gif" height="72" width="72"/></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6697244717008085794.post-6650871251759338656</guid><pubDate>Tue, 17 Nov 2009 05:46:00 +0000</pubDate><atom:updated>2009-11-17T01:37:49.996-08:00</atom:updated><title>Show Visitor&#39;s Country Currency Using ASP and MS-SQL 2008 Database</title><description>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://www.ip2location.com/ip-country.aspx&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 109px; height: 104px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx3b8HvWVX0ZFx8sykRVGgAqaASG1WK2TtGO5We9QlSuNBfnoQdWtFxRSOx9a5Qg3pricgAhPPAK_T_zfCZp_4OjQsBN8JJuyuiHl2j37ydIo8PzVyd38EkxxpEU_Wbl3oj-ctOOSn8lJ9/s320/db1product.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5404945860109004546&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;div style=&quot;font-family: arial; font-size: 9pt;&quot;&gt;More and more companies are realizing the importance of doing business online as a way of improving their market share. With this realization comes the need to deal with customers from around the world and their various currencies. This is when being able to show the pricing on a website in the visitor’s local currency would make the online shopping experience more user-friendly; eliminating the usual headache of foreign currency conversion.&lt;br /&gt;&lt;br /&gt;In this tutorial, we will use the &lt;a href=&quot;http://www.ip2location.com/ip-country.aspx&quot; target=&quot;_blank&quot;&gt;IP2Location™IP-Country database&lt;/a&gt; to determine the country of origin for the web visitor just by checking the IP address. Instead of loading the full database with 50000+ records, we could simplify this tutorial with the assumption that only two different IP address ranges in the world. IP addresses of the range 0.0.0.0 - 126.255.255.255 originates from the United States. Meanwhile, IP addresses of the range 127.0.0.0 - 255.255.255.255 originates from Japan. Here we are creating a database called &quot;&lt;b&gt;IP2Location&lt;/b&gt;&quot; with a table called &quot;&lt;b&gt;IPCountry&lt;/b&gt;&quot; which contains our two IP address range records.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Step 1: Start Microsoft SQL Server Management Studio.&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;Now, login to your database instance and then click on the New Query button. Copy the 2 lines of SQL codes below into the query window and press Execute to run the codes. This will create the ‘&lt;b&gt;IP2Location&lt;/b&gt;’ database and select it for use.&lt;br /&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:blue&#39;&gt;CREATE&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt; &lt;span style=&#39;color:blue&#39;&gt;DATABASE&lt;/span&gt; IP2Location&lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:blue&#39;&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:blue&#39;&gt;USE&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt; IP2Location&lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:blue&#39;&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhysrXjLbqxL4qJI0Eu1h0b24tsNCGk1jeGW7mptWv4AJLmdu3Bv35sYWc8Fm47xWJKtStP-huFghJrjM-spxlotwU0qDsVMnk2nLKuogfWwdBGP-44yvRpaZRWW0fQ86bkxR_3jhDpyTp9/s1600/IP2Location-MSSQLStep1.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 178px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhysrXjLbqxL4qJI0Eu1h0b24tsNCGk1jeGW7mptWv4AJLmdu3Bv35sYWc8Fm47xWJKtStP-huFghJrjM-spxlotwU0qDsVMnk2nLKuogfWwdBGP-44yvRpaZRWW0fQ86bkxR_3jhDpyTp9/s320/IP2Location-MSSQLStep1.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5404960851315977106&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Step 2:  Next, run the SQL statement below to create the ‘&lt;b&gt;IPCountry&lt;/b&gt;’ table.&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:blue&#39;&gt;CREATE&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;&#39;&gt; &lt;span style=&#39;color:blue&#39;&gt;TABLE&lt;/span&gt;[dbo]&lt;span style=&#39;color:gray&#39;&gt;.&lt;/span&gt;[IPCountry]&lt;span style=&#39;color:blue&#39;&gt; &lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;(&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt;[ipFROM] [float] &lt;span style=&#39;color:gray&#39;&gt;NOT&lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;NULL&lt;/span&gt; &lt;span style=&#39;color:gray&#39;&gt;,&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt;[ipTO] [float] &lt;span style=&#39;color:gray&#39;&gt;NOT&lt;/span&gt; &lt;span style=&#39;color:gray&#39;&gt;NULL&lt;/span&gt; &lt;span style=&#39;color:gray&#39;&gt;,&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt;[countrySHORT] [nvarchar]&lt;span style=&#39;color:blue&#39;&gt; &lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;(&lt;/span&gt;2&lt;span style=&#39;color:gray&#39;&gt;),&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt;[countryLONG] [nvarchar]&lt;span style=&#39;color:blue&#39;&gt; &lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;(&lt;/span&gt;64&lt;span style=&#39;color:gray&#39;&gt;)&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:gray&#39;&gt;)&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt; &lt;span style=&#39;color:blue&#39;&gt;ON&lt;/span&gt; [PRIMARY] &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;;color:blue&#39;&gt;GO&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAm4dfjhPHrgnkPaw9tML5HC9ce7YGfWXG0tOqrwmAdt7zBik8vh3BSljYtAi9Qe7L7N-PT83IM0sJ_gu0WkKi7v5_hgfL1qsp9E5RNvUQb-8eiOxYcN8TzSnQ3xy0NhD9p3dMFtU7JPfU/s1600/IP2Location-MSSQLStep2.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 241px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAm4dfjhPHrgnkPaw9tML5HC9ce7YGfWXG0tOqrwmAdt7zBik8vh3BSljYtAi9Qe7L7N-PT83IM0sJ_gu0WkKi7v5_hgfL1qsp9E5RNvUQb-8eiOxYcN8TzSnQ3xy0NhD9p3dMFtU7JPfU/s320/IP2Location-MSSQLStep2.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5404961086167914882&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Step 3: Run the SQL codes below to insert dummy data into the database.&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:blue&#39;&gt;INSERT&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;&#39;&gt; &lt;span style=&#39;color:blue&#39;&gt;INTO&lt;/span&gt; IPCountry &lt;span style=&#39;color:blue&#39;&gt;VALUES &lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;(&lt;/span&gt;0&lt;span style=&#39;color:gray&#39;&gt;,&lt;/span&gt; 2130706431&lt;span style=&#39;color:gray&#39;&gt;,&lt;/span&gt;&lt;span style=&#39;color:red&#39;&gt;&#39;US&#39;&lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;,&lt;/span&gt;&lt;span style=&#39;color:red&#39;&gt;&#39;UNITED STATES&#39;&lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;; color:blue&#39;&gt;INSERT&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;&#39;&gt; &lt;span style=&#39;color:blue&#39;&gt;INTO&lt;/span&gt; IPCountry &lt;span style=&#39;color:blue&#39;&gt;VALUES &lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;(&lt;/span&gt;2130706432&lt;span style=&#39;color:gray&#39;&gt;,&lt;/span&gt; 4294967295&lt;span style=&#39;color:gray&#39;&gt;,&lt;/span&gt;&lt;span style=&#39;color:red&#39;&gt;&#39;JP&#39;&lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;,&lt;/span&gt;&lt;span style=&#39;color:red&#39;&gt;&#39;JAPAN&#39;&lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_O7AiGqWR_VsN1xXUDBWo_37wgZGs2QbtLjE6qjCqAab8KtHk8DRO1QLCMbM1UvXIIB2jF8iW0g7t_kPz2INZc4F361XiRD4wZv3Pmo2uKrpzUX_LYKR2ZiH2lmJbNokhbm6pJFKldWPA/s1600/IP2Location-MSSQLStep3.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 241px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_O7AiGqWR_VsN1xXUDBWo_37wgZGs2QbtLjE6qjCqAab8KtHk8DRO1QLCMbM1UvXIIB2jF8iW0g7t_kPz2INZc4F361XiRD4wZv3Pmo2uKrpzUX_LYKR2ZiH2lmJbNokhbm6pJFKldWPA/s320/IP2Location-MSSQLStep3.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5404961221778900898&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The full version of IP-Country database is available for subscription at $49/year from &lt;a href=&quot;http://www.ip2location.com/ip-country.aspx&quot; target=&quot;_blank&quot;&gt;http://www.ip2location.com/ip-country.aspx&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikHiI8mzkJeY-LFq6-v5rh-K_FF6NZET20loEMhz5vxWVllcJ0WSv8LK8b22h2eTqT5vgt3JF-MVMut6ZCqfAVqM84OO230Ylyh_JGALFcaPOUg_jOJl8QWgac8toFN4Cge8b5fCs2VV9U/s1600/IP2Location-DB1.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 212px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikHiI8mzkJeY-LFq6-v5rh-K_FF6NZET20loEMhz5vxWVllcJ0WSv8LK8b22h2eTqT5vgt3JF-MVMut6ZCqfAVqM84OO230Ylyh_JGALFcaPOUg_jOJl8QWgac8toFN4Cge8b5fCs2VV9U/s320/IP2Location-DB1.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5404963096993456786&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Step 4: Run the SQL statement below to create the &#39;Countries&#39; table&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;;color:blue&#39;&gt;CREATE&lt;/span&gt;&lt;span style=&#39;font-size:10.0pt;font-family:&quot;Courier New&quot;&#39;&gt; &lt;span style=&#39;color:blue&#39;&gt;TABLE&lt;/span&gt; [dbo]&lt;span style=&#39;color:gray&#39;&gt;.&lt;/span&gt;[Countries]&lt;span style=&#39;color:blue&#39;&gt; &lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;(&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt; [TLD] [nvarchar]&lt;span style=&#39;color:blue&#39;&gt; &lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;(&lt;/span&gt;3&lt;span style=&#39;color:gray&#39;&gt;),&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt; [Country][nvarchar]&lt;span style=&#39;color:blue&#39;&gt; &lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;(&lt;/span&gt;100&lt;span style=&#39;color:gray&#39;&gt;),&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt; [FIPS104][nvarchar]&lt;span style=&#39;color:blue&#39;&gt; &lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;(&lt;/span&gt;2&lt;span style=&#39;color:gray&#39;&gt;),&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt; [ISO2] [nvarchar]&lt;span style=&#39;color:blue&#39;&gt; &lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;(&lt;/span&gt;2&lt;span style=&#39;color:gray&#39;&gt;),&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt; [IOS3] [nvarchar]&lt;span style=&#39;color:blue&#39;&gt; &lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;(&lt;/span&gt;3&lt;span style=&#39;color:gray&#39;&gt;),&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt; [Capital] [nvarchar]&lt;span style=&#39;color:blue&#39;&gt; &lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;(&lt;/span&gt;100&lt;span style=&#39;color:gray&#39;&gt;),&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt; [Region] [nvarchar]&lt;span style=&#39;color:blue&#39;&gt; &lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;(&lt;/span&gt;100&lt;span style=&#39;color:gray&#39;&gt;),&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt; [Currency] [nvarchar]&lt;span style=&#39;color:blue&#39;&gt; &lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;(&lt;/span&gt;50&lt;span style=&#39;color:gray&#39;&gt;),&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt; [CurrencyCode] [nvarchar]&lt;span style=&#39;color:blue&#39;&gt; &lt;/span&gt;&lt;span style=&#39;color:gray&#39;&gt;(&lt;/span&gt;3&lt;span style=&#39;color:gray&#39;&gt;),&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt; [Population] [int] &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt; &lt;span style=&#39;color:gray&#39;&gt;)&lt;/span&gt; &lt;span style=&#39;color:blue&#39;&gt;ON&lt;/span&gt; [PRIMARY] &lt;/span&gt;&lt;br /&gt;&lt;span style=&#39;font-size:10.0pt; font-family:&quot;Courier New&quot;&#39;&gt; &lt;span style=&#39;color:blue&#39;&gt;GO&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwy6AisZW0WUvPlKhode8rCWE1WsOLHPx9Cfro4JmdZkjftdGY7lYwrknIg3jGopD3Tkkfx41POE7uDVmZHrxPMXe21Tlu3hxvjl-IM4-i6ZLfvi2gt23b-hlTZl44TnRvw8QjWGSHhaW_/s1600/IP2Location-MSSQLStep4.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 241px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwy6AisZW0WUvPlKhode8rCWE1WsOLHPx9Cfro4JmdZkjftdGY7lYwrknIg3jGopD3Tkkfx41POE7uDVmZHrxPMXe21Tlu3hxvjl-IM4-i6ZLfvi2gt23b-hlTZl44TnRvw8QjWGSHhaW_/s320/IP2Location-MSSQLStep4.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5404961605418814786&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The country information is available for FREE at &lt;a href=&quot;http://www.ip2location.com/countryinformation.aspx&quot; target=&quot;_blank&quot;&gt;http://www.ip2location.com/countryinformation.aspx&lt;/a&gt; . It consists of the top level domain (TLD), ISO-3166, country, capital, region, currency, currency code and population. Download and load the data into your database. It&#39;s available in several formats such as Comma-delimited ASCII, Microsoft® Access &amp;amp; Microsoft® Excel.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEAyuqDTYCUzlrETFwuxHPhP9lsz3MnyY_MzRaKzG9eBDhyvFKz-1MNL2nNXdzUFFNyNpxyxumnn3ALcwPlNVafp7bH4rTVF13N9HIQLG5kUGmHSyjDZ7RxZuUFaG4fudmQZefXC6FfK2x/s1600/IP2Location-CountryInformation.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 208px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEAyuqDTYCUzlrETFwuxHPhP9lsz3MnyY_MzRaKzG9eBDhyvFKz-1MNL2nNXdzUFFNyNpxyxumnn3ALcwPlNVafp7bH4rTVF13N9HIQLG5kUGmHSyjDZ7RxZuUFaG4fudmQZefXC6FfK2x/s320/IP2Location-CountryInformation.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5404961908493213058&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In your ASP page, you will need to put in the codes below.&lt;br /&gt;&lt;br /&gt;&amp;lt;%&lt;br /&gt;&lt;br&gt;&lt;br /&gt;Dim conn, myDSN, mySQL, rs, mySQL2, rs2&lt;br /&gt;&lt;br&gt;&lt;br&gt;&#39; SQL database connection. NOTE: Replace servername, username and password to your own values.&lt;br /&gt;&lt;br&gt;Set conn = Server.CreateObject(&quot;ADODB.Connection&quot;)&lt;br /&gt;&lt;br&gt;myDSN=&quot;DRIVER={SQLServer};SERVER=servername;UID=username;PWD=password;DATABASE=IP2Location&quot;&lt;br /&gt;&lt;br&gt;&lt;br&gt;conn.open myDNS&lt;br /&gt;&lt;br&gt;&lt;br&gt;&#39; retrieve visitor IP address and translate it to IP address number&lt;br /&gt;&lt;br&gt;IPno = Dot2LongIP(Request.ServerVariables(&quot;REMOTE_ADDR&quot;)) &lt;br /&gt;&lt;br&gt;&lt;br&gt;&#39; SQL query to lookup valid range of IP address&lt;br /&gt;&lt;br&gt;mySQL = &quot;SELECT countrySHORT FROM IPCountry WHERE &quot; &amp;amp; IPno &amp;amp; &quot; BETWEEN ipFROM AND ipTO&quot;&lt;br /&gt;&lt;br&gt;Set rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)&lt;br /&gt;&lt;br&gt;rs.open mySQL, conn&lt;br /&gt;&lt;br&gt;&lt;br&gt;&#39; assign country name for reference&lt;br /&gt;&lt;br&gt;countryName = rs(&quot;countrySHORT&quot;)&lt;br /&gt;&lt;br&gt;&lt;br&gt;&#39; SQL query to lookup currency code&lt;br /&gt;&lt;br&gt;mySQL2 = &quot;SELECT CurrencyCode FROM Countries WHERE TLD=&#39;&quot; &amp;amp; countryName &amp;amp; &quot;&#39;&quot;&lt;br /&gt;&lt;br&gt;&lt;br&gt;Set rs2 = Server.CreateObject(&quot;ADODB.Recordset&quot;)&lt;br /&gt;&lt;br&gt;rs2.open mySQL2, conn&lt;br /&gt;&lt;br&gt;&lt;br&gt;&#39; assign currency code for reference&lt;br /&gt;&lt;br&gt;currencyCode = rs(&quot;currencyCode&quot;)&lt;br /&gt;&lt;br&gt;&lt;br&gt;&#39; close and free connections&lt;br /&gt;&lt;br&gt;rs.close&lt;br /&gt;&lt;br&gt;rs2.close&lt;br /&gt;&lt;br&gt;conn.close&lt;br /&gt;&lt;br&gt;set rs = nothing&lt;br /&gt;&lt;br&gt;set rs2 = nothing&lt;br /&gt;&lt;br&gt;Set conn = nothing&lt;br /&gt;&lt;br&gt;&lt;br&gt;If CountryName = &quot;JP&quot; Then &#39; Visitor is from Japan&lt;br /&gt;&lt;br&gt;&#39; Show price in YEN&lt;br /&gt;&lt;br&gt;Response.Write &quot;Price: &quot; &amp;amp; currencyCode &amp;amp; &quot; 120.00&quot;&lt;br /&gt;&lt;br&gt;Else &#39; Visitor is not from Japan&lt;br /&gt;&lt;br&gt;&#39; Show price in USD &lt;br /&gt;&lt;br&gt;Response.Write &quot;Price: &quot; &amp;amp; currencyCode &amp;amp; &quot; 1.00&quot;&lt;br /&gt;&lt;br&gt;End If&lt;br /&gt;&lt;br&gt;&lt;br&gt;Function Dot2LongIP (ByVal DottedIP)&lt;br /&gt;&lt;br&gt;Dim i, pos&lt;br /&gt;&lt;br&gt;Dim PrevPos, num&lt;br /&gt;&lt;br&gt;If DottedIP = &quot;&quot; Then&lt;br /&gt;&lt;br&gt;Dot2LongIP = 0&lt;br /&gt;&lt;br&gt;Else&lt;br /&gt;&lt;br&gt;For i = 1 To 4&lt;br /&gt;&lt;br&gt;pos = InStr(PrevPos + 1, DottedIP, &quot;.&quot;, 1)&lt;br /&gt;&lt;br&gt;If i = 4 Then&lt;br /&gt;&lt;br&gt;pos = Len(DottedIP) + 1&lt;br /&gt;&lt;br&gt;End If&lt;br /&gt;&lt;br&gt;num = Int(Mid(DottedIP, PrevPos + 1, pos - PrevPos - 1))&lt;br /&gt;&lt;br&gt;PrevPos = pos&lt;br /&gt;&lt;br&gt;Dot2LongIP = ((num Mod 256) * (256 ^ (4 - i))) + Dot2LongIP&lt;br /&gt;&lt;br&gt;Next&lt;br /&gt;&lt;br&gt;End If&lt;br /&gt;&lt;br&gt;End Function %&amp;gt;&lt;br /&gt;&lt;br /&gt;What you have seen here today is just the tip of the iceberg of what you can do with the &lt;a href=&quot;http://www.ip2location.com/ip-country.aspx&quot; taget=&quot;_blank&quot;&gt;IP2Location™IP-Country database&lt;/a&gt;. You could even pair the code above with a forex service to get a real-time conversion rate for the currencies thus making your currency conversions even more up-to-date. Now that you have realized the power of the &lt;a href=&quot;http://www.ip2location.com/ip-country.aspx&quot; taget=&quot;_blank&quot;&gt;IP2Location™IP-Country database&lt;/a&gt;, you will benefit even more from the more advanced databases available from IP2Location. You can try out the online demo at &lt;a href=&quot;http://www.ip2location.com/demo.aspx&quot; target=&quot;_blank&quot;&gt;http://www.ip2location.com/demo.aspx&lt;/a&gt; and see for yourself what you are missing.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-T9BFlyfTbQS5BI_DhKnmeaO6jiOoi1hOqc7TBCCGZaMrA3-KZvZOcuo4lnQ1JF6-LZz-nd5gIe3mVLjdrtY8EMPauLOmXYg1ZFMYFULx2HcSMzqdWV_bKsInzRD0qhctT9xSYpSI7Ue8/s1600/IP2Location-LiveDemo.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 215px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-T9BFlyfTbQS5BI_DhKnmeaO6jiOoi1hOqc7TBCCGZaMrA3-KZvZOcuo4lnQ1JF6-LZz-nd5gIe3mVLjdrtY8EMPauLOmXYg1ZFMYFULx2HcSMzqdWV_bKsInzRD0qhctT9xSYpSI7Ue8/s320/IP2Location-LiveDemo.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5404962196276015746&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://ipgeolocation.blogspot.com/2009/11/show-visitors-country-currency-using.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx3b8HvWVX0ZFx8sykRVGgAqaASG1WK2TtGO5We9QlSuNBfnoQdWtFxRSOx9a5Qg3pricgAhPPAK_T_zfCZp_4OjQsBN8JJuyuiHl2j37ydIo8PzVyd38EkxxpEU_Wbl3oj-ctOOSn8lJ9/s72-c/db1product.gif" height="72" width="72"/></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6697244717008085794.post-8859288353878369319</guid><pubDate>Tue, 06 Oct 2009 07:13:00 +0000</pubDate><atom:updated>2009-10-06T00:34:55.942-07:00</atom:updated><title>IP2Location 封锁来自特定国家的在线访客</title><description>&lt;div style=&quot;font-family: arial; font-size: 9pt;&quot;&gt;&lt;img style=&quot;margin: 0px 10px 10px 0px; float: left; width: 150px; height: 150px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6FXp38nTDXFDABJkVACbH8h_nffDllvDyYun0dbL92KxK1KpqzqWhfr-sdgXD5XXkPB9PVk1g2mJRY_jgIO1KvGBKIBAL5EaUm1FXL6rB6c3TzeR9ko8N53hbgoyWB2DbcXcX0tICEFGr/s320/blockvisitorsbycountry.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5389009074141943698&quot; border=&quot;0&quot; /&gt;如果你发现来自某些国家的网络用户经常：:&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjycO8a2mwVjiT1kki7kodtqpmOkOxNRBMUNDKTOANYfkIL1GHbf7Ti3jarWYeG0H4m3oELUPrykCg2imusV_-CeqS2Y4PUpwSab6Pekl31gWRUs8ljp6FZoia7bWzIKN0VgnSdLKes3D59/s200/redarrow.jpg&quot; style=&quot;border: 0px none ;&quot; /&gt;&lt;span style=&quot;position: relative; top: -8px;&quot;&gt;发送垃圾邮件，不相关或不适当的信息到你网站的电子邮件&lt;/span&gt;&lt;br /&gt;&lt;img style=&quot;border: 0px none ;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjycO8a2mwVjiT1kki7kodtqpmOkOxNRBMUNDKTOANYfkIL1GHbf7Ti3jarWYeG0H4m3oELUPrykCg2imusV_-CeqS2Y4PUpwSab6Pekl31gWRUs8ljp6FZoia7bWzIKN0VgnSdLKes3D59/s200/redarrow.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5389035700563709362&quot; border=&quot;0&quot; /&gt;&lt;span style=&quot;position: relative; top: -8px;&quot;&gt;从你的网站下载了大量的数据&lt;/span&gt;&lt;br /&gt;&lt;img style=&quot;border: 0px none ;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjycO8a2mwVjiT1kki7kodtqpmOkOxNRBMUNDKTOANYfkIL1GHbf7Ti3jarWYeG0H4m3oELUPrykCg2imusV_-CeqS2Y4PUpwSab6Pekl31gWRUs8ljp6FZoia7bWzIKN0VgnSdLKes3D59/s200/redarrow.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5389035700563709362&quot; border=&quot;0&quot; /&gt;&lt;span style=&quot;position: relative; top: -8px;&quot;&gt;从你的网站的下载页面上窃取你的数码产品&lt;/span&gt;&lt;br /&gt;&lt;img style=&quot;border: 0px none ;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjycO8a2mwVjiT1kki7kodtqpmOkOxNRBMUNDKTOANYfkIL1GHbf7Ti3jarWYeG0H4m3oELUPrykCg2imusV_-CeqS2Y4PUpwSab6Pekl31gWRUs8ljp6FZoia7bWzIKN0VgnSdLKes3D59/s200/redarrow.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5389035700563709362&quot; border=&quot;0&quot; /&gt;&lt;span style=&quot;position: relative; top: -8px;&quot;&gt;盗取你的软件并非法分发或享用&lt;/span&gt;&lt;br /&gt;&lt;img style=&quot;border: 0px none ;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjycO8a2mwVjiT1kki7kodtqpmOkOxNRBMUNDKTOANYfkIL1GHbf7Ti3jarWYeG0H4m3oELUPrykCg2imusV_-CeqS2Y4PUpwSab6Pekl31gWRUs8ljp6FZoia7bWzIKN0VgnSdLKes3D59/s200/redarrow.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5389035700563709362&quot; border=&quot;0&quot; /&gt;&lt;span style=&quot;position: relative; top: -8px;&quot;&gt;通过链接直接在自己的网站上使用你的服务器上的图像，在同一时间内窃取你的图像并使用你的带宽&lt;/span&gt;&lt;br /&gt;&lt;img style=&quot;border: 0px none ;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjycO8a2mwVjiT1kki7kodtqpmOkOxNRBMUNDKTOANYfkIL1GHbf7Ti3jarWYeG0H4m3oELUPrykCg2imusV_-CeqS2Y4PUpwSab6Pekl31gWRUs8ljp6FZoia7bWzIKN0VgnSdLKes3D59/s200/redarrow.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5389035700563709362&quot; border=&quot;0&quot; /&gt;&lt;span style=&quot;position: relative; top: -8px;&quot;&gt;利用垃圾信息发布机骚扰你的网站&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;实际上，你可以使用&lt;b&gt;IP2Location&lt;/b&gt;所提供的&lt;a href=&quot;http://www.ip2location.com/blockvisitorsbycountry.aspx&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;封锁来自特定国家的在线访客&lt;/b&gt;&lt;/a&gt;免费服务阻止及控制来自某些国家在线访客的 恶意流量到你的网站以便节省你网络的带宽资源。&lt;br /&gt;&lt;br /&gt;不仅如此，但你也可以利用这个服务来限制你的网站访客，如果你在网上所销售的产品只限定于某些地区或国家。&lt;br /&gt;&lt;br /&gt;只需两个简单的步骤就能制作免费的htaccess文件。首先，选择你所想要阻止的访客的国家名单，你可以选择30个国家，如果你注册一个&lt;b&gt;IP2Location&lt;/b&gt;的&lt;a href=&quot;http://www.ip2location.com/demoaccount.aspx?id=bvbc&quot; target=&quot;_blank&quot;&gt;免费帐户&lt;/a&gt;。&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkZv9AQLqIQFMvEHZ7UHM7nBpQN-CjC1p_LotNADlAIwcOuZDQcNx42OoWhysgv6TQWrsOs7afI7gA7KX9atPm5MzzrizUhACIbEgJsDUVwdwEOEZu6giVdmyh3CXEzw3PtcoX8GTsyFNG/s1600-h/blockvisitorsbycountry_step1.jpg&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 222px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkZv9AQLqIQFMvEHZ7UHM7nBpQN-CjC1p_LotNADlAIwcOuZDQcNx42OoWhysgv6TQWrsOs7afI7gA7KX9atPm5MzzrizUhACIbEgJsDUVwdwEOEZu6giVdmyh3CXEzw3PtcoX8GTsyFNG/s320/blockvisitorsbycountry_step1.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5388999468680866386&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;然后选择你的输出格式: &lt;b&gt;htaccess&lt;/b&gt;，&lt;b&gt;iptables&lt;/b&gt;或&lt;b&gt;CIDR格式&lt;/b&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbRwgH_coQEniGgs9xpK4k8uHoW4Vzxig2vZ1sXHq2AaxtHAWV4iJJxaSb0Mih7e1moNS2yVtlyOu8MpSSBQrkIZXu43fU4HB5Uj_poVpN8Co_EJk2Mj_mU7samptZYXtPiC_qB59fhMpn/s1600-h/blockvisitorsbycountry_step2.jpg&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 226px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbRwgH_coQEniGgs9xpK4k8uHoW4Vzxig2vZ1sXHq2AaxtHAWV4iJJxaSb0Mih7e1moNS2yVtlyOu8MpSSBQrkIZXu43fU4HB5Uj_poVpN8Co_EJk2Mj_mU7samptZYXtPiC_qB59fhMpn/s320/blockvisitorsbycountry_step2.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5389001972432726370&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;按”&lt;b&gt;Generate&lt;/b&gt;”按钮，复制并粘贴数据输出到你的外部文件中。&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiay-kPGhUW3S_XrlAV5g_698Yd4Dqck6ubCrDXDnJCnDxqe6Pkd6CjE6hahfPEu0k4uO-6AjtMJYM6v26wTH2zGY09kULoomPr_QLg2xLUh2Rr3HtRg5MbanzpEzQsijNV9d47Y6aL-K33/s1600-h/blockvisitorsbycountry_step3.jpg&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 230px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiay-kPGhUW3S_XrlAV5g_698Yd4Dqck6ubCrDXDnJCnDxqe6Pkd6CjE6hahfPEu0k4uO-6AjtMJYM6v26wTH2zGY09kULoomPr_QLg2xLUh2Rr3HtRg5MbanzpEzQsijNV9d47Y6aL-K33/s320/blockvisitorsbycountry_step3.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5389002187564011842&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;IP2Location封锁来自特定国家的在线访客&lt;/b&gt;提供免费下载最新的国家清单。我们的数据是检索自最新最全面的&lt;b&gt;IP2Location&lt;/b&gt;数据库。&lt;b&gt;IP2Location&lt;/b&gt;数据库每月更新一次，以确保数据库的高精度。你可以有效地封锁来自特定国家不必要或恶意的流量。这样的活动包括网上猖獗寄送垃圾邮件，以及类似于肆虐盗窃信用卡或个人隐私，用户的帐号和密码这样的犯罪行为。&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://www.ip2location.com/ip2location-isapi-filter.aspx&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 123px; height: 150px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6HxeaFu-fypzlqT_w8uixNlNX0TsZrcfjkWTNV_s4JxaO6j8A42ZILBc8P5eLgCjD0l334uiDD8I1rF4zd0ympl-Fxn4ZHHHVKAHYPdslajRoquxq0rUhw3SK0ZCf-OwaVGDOqnPI2eP0/s320/isapi1.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5389002601444324098&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;如果你想在IIS 互联网信息服务器上封锁来自特定国家的在线访客 ，您可以查询&lt;b&gt;IP2Location&lt;/b&gt;的&lt;a href=&quot;http://www.ip2location.com/ip2location-isapi-filter.aspx&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;ISAPI Filter&lt;/b&gt;&lt;/a&gt;。&lt;b&gt;IP2Location ISAPI Filter&lt;/b&gt;是一个互联网服务器应用程序编程接口（&lt;b&gt;ISAPI&lt;/b&gt;）插件，可以运行在任何使用IIS 互联网信息服务器上。它能让你从在线访问者的IP地址轻松获取其确切的地理位置信息。它使用服务器字段，让你能够根据访问者的国家，地区，城市，纬度，经度，邮政编码，互联网服务提供商，域名等地理位置信息来设定或更改页面内容。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://ipgeolocation.blogspot.com/2009/10/ip2location.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6FXp38nTDXFDABJkVACbH8h_nffDllvDyYun0dbL92KxK1KpqzqWhfr-sdgXD5XXkPB9PVk1g2mJRY_jgIO1KvGBKIBAL5EaUm1FXL6rB6c3TzeR9ko8N53hbgoyWB2DbcXcX0tICEFGr/s72-c/blockvisitorsbycountry.jpg" height="72" width="72"/></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6697244717008085794.post-2559188505789441833</guid><pubDate>Mon, 05 Oct 2009 06:06:00 +0000</pubDate><atom:updated>2009-10-05T02:29:51.712-07:00</atom:updated><title>Block online visitors by country for FREE with the most up-to-date IP2Location database</title><description>&lt;div style=&quot;font-family: arial; font-size: 9pt;&quot;&gt;&lt;img style=&quot;margin: 0px 10px 10px 0px; float: left; width: 150px; height: 150px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6FXp38nTDXFDABJkVACbH8h_nffDllvDyYun0dbL92KxK1KpqzqWhfr-sdgXD5XXkPB9PVk1g2mJRY_jgIO1KvGBKIBAL5EaUm1FXL6rB6c3TzeR9ko8N53hbgoyWB2DbcXcX0tICEFGr/s320/blockvisitorsbycountry.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5389009074141943698&quot; border=&quot;0&quot; /&gt;If you find that online visitors from certain countries are regularly doing the following:&lt;br&gt;&lt;br /&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjycO8a2mwVjiT1kki7kodtqpmOkOxNRBMUNDKTOANYfkIL1GHbf7Ti3jarWYeG0H4m3oELUPrykCg2imusV_-CeqS2Y4PUpwSab6Pekl31gWRUs8ljp6FZoia7bWzIKN0VgnSdLKes3D59/s200/redarrow.jpg&quot; style=&quot;border: 0px;&quot;&gt;&lt;span style=&quot;position: relative; top: -8px;&quot;&gt;spamming your website by sending unwanted, irrelevant or inappropriate messages&lt;/span&gt;&lt;br /&gt;&lt;img style=&quot;border: 0px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjycO8a2mwVjiT1kki7kodtqpmOkOxNRBMUNDKTOANYfkIL1GHbf7Ti3jarWYeG0H4m3oELUPrykCg2imusV_-CeqS2Y4PUpwSab6Pekl31gWRUs8ljp6FZoia7bWzIKN0VgnSdLKes3D59/s200/redarrow.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5389035700563709362&quot; border=&quot;0&quot; /&gt;&lt;span style=&quot;position: relative; top: -8px;&quot;&gt;downloading huge quantities of data from your website&lt;/span&gt;&lt;br /&gt;&lt;img style=&quot;border: 0px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjycO8a2mwVjiT1kki7kodtqpmOkOxNRBMUNDKTOANYfkIL1GHbf7Ti3jarWYeG0H4m3oELUPrykCg2imusV_-CeqS2Y4PUpwSab6Pekl31gWRUs8ljp6FZoia7bWzIKN0VgnSdLKes3D59/s200/redarrow.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5389035700563709362&quot; border=&quot;0&quot; /&gt;&lt;span style=&quot;position: relative; top: -8px;&quot;&gt;scamming your website and stealing your digital products from your download page&lt;/span&gt;&lt;br /&gt;&lt;img style=&quot;border: 0px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjycO8a2mwVjiT1kki7kodtqpmOkOxNRBMUNDKTOANYfkIL1GHbf7Ti3jarWYeG0H4m3oELUPrykCg2imusV_-CeqS2Y4PUpwSab6Pekl31gWRUs8ljp6FZoia7bWzIKN0VgnSdLKes3D59/s200/redarrow.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5389035700563709362&quot; border=&quot;0&quot; /&gt;&lt;span style=&quot;position: relative; top: -8px;&quot;&gt;pirating your software and distributing it illegally&lt;/span&gt;&lt;br /&gt;&lt;img style=&quot;border: 0px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjycO8a2mwVjiT1kki7kodtqpmOkOxNRBMUNDKTOANYfkIL1GHbf7Ti3jarWYeG0H4m3oELUPrykCg2imusV_-CeqS2Y4PUpwSab6Pekl31gWRUs8ljp6FZoia7bWzIKN0VgnSdLKes3D59/s200/redarrow.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5389035700563709362&quot; border=&quot;0&quot; /&gt;&lt;span style=&quot;position: relative; top: -8px;&quot;&gt;using your images on their websites by linking directly to your server thereby stealing your images and using up your bandwidth at the same time&lt;/span&gt;&lt;br /&gt;&lt;img style=&quot;border: 0px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjycO8a2mwVjiT1kki7kodtqpmOkOxNRBMUNDKTOANYfkIL1GHbf7Ti3jarWYeG0H4m3oELUPrykCg2imusV_-CeqS2Y4PUpwSab6Pekl31gWRUs8ljp6FZoia7bWzIKN0VgnSdLKes3D59/s200/redarrow.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5389035700563709362&quot; border=&quot;0&quot; /&gt;&lt;span style=&quot;position: relative; top: -8px;&quot;&gt;sending spambots to harvest your site&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can actually block the online visitors from certain countries for Apache Web server by using the &lt;a href=&quot;http://www.ip2location.com/blockvisitorsbycountry.aspx&quot; target=&quot;_blank&quot;&gt;IP2Location Block Visitors by Country&lt;/a&gt; Free Services to block malicious traffic to your website to save your bandwidth.&lt;br /&gt;&lt;br /&gt;Not only that, but you could also utilize this service to limit web site access to visitors from countries where you actually sell your products.&lt;br /&gt;&lt;br /&gt;Just two simple steps to generate the free .htaccess file. First, select the country that you want to block from the list of countries; you can select up to 30 countries at one time if you register a &lt;a href=&quot;http://www.ip2location.com/demoaccount.aspx?id=bvbc&quot; target=&quot;_blank&quot;&gt;free account&lt;/a&gt; on IP2Location.&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkZv9AQLqIQFMvEHZ7UHM7nBpQN-CjC1p_LotNADlAIwcOuZDQcNx42OoWhysgv6TQWrsOs7afI7gA7KX9atPm5MzzrizUhACIbEgJsDUVwdwEOEZu6giVdmyh3CXEzw3PtcoX8GTsyFNG/s1600-h/blockvisitorsbycountry_step1.jpg&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 222px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkZv9AQLqIQFMvEHZ7UHM7nBpQN-CjC1p_LotNADlAIwcOuZDQcNx42OoWhysgv6TQWrsOs7afI7gA7KX9atPm5MzzrizUhACIbEgJsDUVwdwEOEZu6giVdmyh3CXEzw3PtcoX8GTsyFNG/s320/blockvisitorsbycountry_step1.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5388999468680866386&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Then choose your output in &lt;b&gt;.htaccess&lt;/b&gt;, &lt;b&gt;iptables&lt;/b&gt; or &lt;b&gt;CIDR format&lt;/b&gt;:&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbRwgH_coQEniGgs9xpK4k8uHoW4Vzxig2vZ1sXHq2AaxtHAWV4iJJxaSb0Mih7e1moNS2yVtlyOu8MpSSBQrkIZXu43fU4HB5Uj_poVpN8Co_EJk2Mj_mU7samptZYXtPiC_qB59fhMpn/s1600-h/blockvisitorsbycountry_step2.jpg&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 226px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbRwgH_coQEniGgs9xpK4k8uHoW4Vzxig2vZ1sXHq2AaxtHAWV4iJJxaSb0Mih7e1moNS2yVtlyOu8MpSSBQrkIZXu43fU4HB5Uj_poVpN8Co_EJk2Mj_mU7samptZYXtPiC_qB59fhMpn/s320/blockvisitorsbycountry_step2.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5389001972432726370&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Press the &lt;b&gt;Generate&lt;/b&gt; button, copy and paste the configuration into your external file.&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiay-kPGhUW3S_XrlAV5g_698Yd4Dqck6ubCrDXDnJCnDxqe6Pkd6CjE6hahfPEu0k4uO-6AjtMJYM6v26wTH2zGY09kULoomPr_QLg2xLUh2Rr3HtRg5MbanzpEzQsijNV9d47Y6aL-K33/s1600-h/blockvisitorsbycountry_step3.jpg&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 320px; height: 230px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiay-kPGhUW3S_XrlAV5g_698Yd4Dqck6ubCrDXDnJCnDxqe6Pkd6CjE6hahfPEu0k4uO-6AjtMJYM6v26wTH2zGY09kULoomPr_QLg2xLUh2Rr3HtRg5MbanzpEzQsijNV9d47Y6aL-K33/s320/blockvisitorsbycountry_step3.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5389002187564011842&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;IP2Location Block Visitors by Country provides the latest country list for free. Our data is retrieved from the most comprehensive and up-to-date IP2Location database. IP2Location databases are updated every month to ensure high accuracy. You can efficiently block unwanted access from countries that you regularly get non-converting, fraudulent or spamming web traffic.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://www.ip2location.com/ip2location-isapi-filter.aspx&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 123px; height: 150px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6HxeaFu-fypzlqT_w8uixNlNX0TsZrcfjkWTNV_s4JxaO6j8A42ZILBc8P5eLgCjD0l334uiDD8I1rF4zd0ympl-Fxn4ZHHHVKAHYPdslajRoquxq0rUhw3SK0ZCf-OwaVGDOqnPI2eP0/s320/isapi1.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5389002601444324098&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;If you want to block visitors in the IIS Web Server, you can check out the &lt;a href=&quot;http://www.ip2location.com/ip2location-isapi-filter.aspx&quot; target=&quot;_blank&quot;&gt;IP2Location ISAPI Filter&lt;/a&gt;. The IP2Location ISAPI Filter is an Internet Server Application Programming Interface (ISAPI) plug-in that can be used with any web servers running IIS, which enables you to discover in real-time, where your web visitors are coming from by their IP address. It uses server variables to enable you to dynamically tailor the content of your site based on your visitors’ country, region, city, latitude, longitude, ZIP code, ISP, domain name and so on.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://ipgeolocation.blogspot.com/2009/10/block-online-visitors-by-country-for.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6FXp38nTDXFDABJkVACbH8h_nffDllvDyYun0dbL92KxK1KpqzqWhfr-sdgXD5XXkPB9PVk1g2mJRY_jgIO1KvGBKIBAL5EaUm1FXL6rB6c3TzeR9ko8N53hbgoyWB2DbcXcX0tICEFGr/s72-c/blockvisitorsbycountry.jpg" height="72" width="72"/></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6697244717008085794.post-1756134173222216258</guid><pubDate>Wed, 02 Sep 2009 10:20:00 +0000</pubDate><atom:updated>2009-09-02T18:47:40.132-07:00</atom:updated><title>如何查询IP地址的地理位置?</title><description>&lt;div style=&quot;font-family: Tahoma; font-size: 11pt;&quot;&gt;此文章将指导你如何使用IP2Location Live Demo来确定IP地址的地理位置或归属地.&lt;br /&gt;&lt;br /&gt;IP2Location是一种IP数据库工具让网站能够确定访客们的地理位置以及其他资料。IP2Location的IP 地址地理位置映射技术借助专有的 IP 地址查找数据库和技术，在不侵犯互联网用户隐私的前提下，可帮你确定访问者的具体地理位置。&lt;br /&gt;&lt;br /&gt;IP是Internet Protocol的英文缩写意思, 是指“网络之间互连的协议” 。电脑在进行网络连接的时候是需要拥有一个IP地址。IP地址是用来标识互联网上计算机的逻辑地址。通过IP地址我们就能够将数据传送到特定的计算机中。每个IP地址都是独特和不会重复的，因此我们可以容易地获取信息从IP地址。&lt;br /&gt;&lt;br /&gt;如果你想查询自己的IP地址的位置，你只需要进入&lt;a href=&quot;http://www.ip2location.com/?rid=841&quot; target=&quot;_blank&quot;&gt;www.ip2location.com&lt;/a&gt; ，你就可以在首页可以看到你的IP地址和地理信息，例如国家，区域，城市，纬度和经度，邮政编码，时区，网速，互联网服务提供商，网域，国家代码，地区代码和气象站。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ_CjLJ-2k6K63oov0zJykPS5wBVuUvOYjBEE6QuOKdSshMxk0knvEwmkyFt1mYGZ82aZqv1XTq2nLd6QfKLvKUd89tso8Nx9tNieHbhx0AarG1Ha9v-77TPh4UF1k9TsdbMJAwimT4Zrw/s1600-h/ip2location-chinaipaddress.jpg&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 400px; height: 256px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ_CjLJ-2k6K63oov0zJykPS5wBVuUvOYjBEE6QuOKdSshMxk0knvEwmkyFt1mYGZ82aZqv1XTq2nLd6QfKLvKUd89tso8Nx9tNieHbhx0AarG1Ha9v-77TPh4UF1k9TsdbMJAwimT4Zrw/s400/ip2location-chinaipaddress.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5376813436473020034&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;上图的IP查詢工具显示网页访问者的IP地理位置信息如下：&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;IP地址: 219.137.144.53&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;地理位置 (国家，区域，城市): 中国, 广州, 广东&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;纬度/经度: 23.117纬度, 113.25经度&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;互联网服务提供商: 中国宽带互联网广东省网路&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;时区: UTC +08:00&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;网速: DSL&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;国家代码: 86&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;气象站: CHXX0037 -广州&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;如果你想探索其他IP地址的地理位置 ，你只需 把IP地址输入在Live Product Demo的空栏里就可以获取IP地址的地理信息。&lt;br /&gt;&lt;br /&gt;我们将示范如何用谷歌Google的IP地址(64.233.167.104)来查詢它的地理信息。我们把地址输入在Live Product Demo的空栏里，点击”Find Location” 的按钮。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyXns5KufKSFmgIYSk_Aws5YKl15p9opebvNPNxA3z79Mu5M2MFiaB66YekszbQTgEwqSXkVfKCvE9tpS6mgl7BOfuTOiidW6htBylZWSkeFRoFNg_490qmUHvuJOOu3DVX7TE-tyxcr49/s1600-h/ip2location-google.JPG&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 400px; height: 226px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyXns5KufKSFmgIYSk_Aws5YKl15p9opebvNPNxA3z79Mu5M2MFiaB66YekszbQTgEwqSXkVfKCvE9tpS6mgl7BOfuTOiidW6htBylZWSkeFRoFNg_490qmUHvuJOOu3DVX7TE-tyxcr49/s400/ip2location-google.JPG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5376813724711033186&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;IP2Location就能显示Google 的IP地址正确的地理信息如下图:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy8SUC6wcxSCEroWRnjbDqy-tzk4UFxnnd6lgyGS_QrzGlXtDEFo67AIyo9cf7HiDgQH9Iw9DhEGSm7u9gnE-WwXFj7syMJcFinzGnx5bqjFbeTjgmDmcTYNRScocWuiTY7eouTEmc-rjL/s1600-h/ip2location-google-ipaddress.JPG&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 400px; height: 275px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy8SUC6wcxSCEroWRnjbDqy-tzk4UFxnnd6lgyGS_QrzGlXtDEFo67AIyo9cf7HiDgQH9Iw9DhEGSm7u9gnE-WwXFj7syMJcFinzGnx5bqjFbeTjgmDmcTYNRScocWuiTY7eouTEmc-rjL/s400/ip2location-google-ipaddress.JPG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5376813888879435890&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;IP地址: 64.233.167.104&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;地理位置 (国家，区域，城市): 美国, 加利福尼亞州, 山景城&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;纬度/经度: 37.3956纬度 / -122.076经度&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;邮政编码: 94043&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;时区: -07:00&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;网速: 網路撥接&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;互联网服务提供商: Google INC&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;网域: google.com&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;国家代码: 1&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;地区代码: 650&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;气象站: USCA0746 –山景城&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;接下来我们将示范如何用YouTube的IP地址(208.65.153.253)来查詢它的地理信息如下图:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhioLV-CbrkrWeDcfW5EjjVz0WzcDPPP01ib4yskDv_ddA8m3a-umcxRQUqRcna7LgCPj0KPAsI9jCnX_MGwCoUwLaKRyAFdbN_27_PJohns9u7MLzUyQc3taB1IBON119JfN2pJ21A7E85/s1600-h/ip2location-youtube-ipaddress-info.JPG&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 400px; height: 276px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhioLV-CbrkrWeDcfW5EjjVz0WzcDPPP01ib4yskDv_ddA8m3a-umcxRQUqRcna7LgCPj0KPAsI9jCnX_MGwCoUwLaKRyAFdbN_27_PJohns9u7MLzUyQc3taB1IBON119JfN2pJ21A7E85/s400/ip2location-youtube-ipaddress-info.JPG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5376814241909142210&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;IP地址: 208.65.153.253&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;地理位置 (国家，区域，城市): 美国, 加利福尼亞州, 圣马特奥&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;纬度/经度: 37.5607纬度 / -122.316经度&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;邮政编码: 94401&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;时区: -08:00&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;网速: 数字用户线&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;互联网服务提供商: YouTube INC&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;国家代码: 1&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;地区代码: 650&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;气象站: USCA1005 –圣马特奥&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;如果您有兴趣索取免费IP地址数据库或IP地址查询工具请访问&lt;a href=&quot;http://www.ip2location.com/demo.aspx?rid=841&quot; target=&quot;_blank&quot;&gt;http://www.ip2location.com/demo.aspx&lt;/a&gt; 。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;IP2Location的革新性地解决方案&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;• 显示当地语言和货币&lt;br /&gt;• 根据地理信息重定向或调整网页&lt;br /&gt;• 数字化权利管理&lt;br /&gt;• 防止密码共用和服务滥用&lt;br /&gt;• 减少信用卡欺诈&lt;br /&gt;• 网页流量记录统计和分析&lt;br /&gt;• 自动在网页的表格中选择国家&lt;br /&gt;• 拦截和过滤没有商业目的的国家&lt;br /&gt;• 地理目标定位，提高网上销售和点击&lt;br /&gt;• 按地理位置过滤垃圾邮件&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.ip2location.com/ip-country-region-city-isp-domain.aspx?rid=841&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 148px; height: 176px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjalg3qeKlMuWS48KfbUzNl-EVV_0TCyk3FoSd7dt6kazcWV0H6gFUazpagSOeeevP0DabBnDpPL83Xotq_GPRfuujAldHBTQsjqlVXgkAqqbZB6LjYPtdUyubHjDil4YyIHJLEkoV5HrGy/s320/db7.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5376814404214684818&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;a href=&quot;http://www.ip2location.com/ip-country-region-city-isp-domain.aspx?rid=841&quot; target=&quot;_blank&quot;&gt;IP2Location IP地址-国家-地区-城市-ISP-网域&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;IP2Location IP地址-国家-地区-城市-ISP-域名数据库包解决方案协助你确定访客们的具体地理位置国家，地区或州，城市, 互联网服务提供商 (ISP) 和网域或域名。 此数据库包查詢在228个国家里超过20,000个主要城市。请点击&lt;a href=&quot;http://www.ip2location.com/samples/IP-COUNTRY-REGION-CITY-ISP-DOMAIN.SAMPLE.TXT?rid=841&quot; target=&quot;_blank&quot;&gt;这里&lt;/a&gt;下载免费的示例代码。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://ipgeolocation.blogspot.com/2009/09/ip.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ_CjLJ-2k6K63oov0zJykPS5wBVuUvOYjBEE6QuOKdSshMxk0knvEwmkyFt1mYGZ82aZqv1XTq2nLd6QfKLvKUd89tso8Nx9tNieHbhx0AarG1Ha9v-77TPh4UF1k9TsdbMJAwimT4Zrw/s72-c/ip2location-chinaipaddress.jpg" height="72" width="72"/></item></channel></rss>