<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: MaxMind GeoLite Country and GeoLite City Made Easy</title>
	<atom:link href="http://www.sequentiallogic.com/2009/05/29/maxmind-geolite-country-and-geolite-city-made-easy/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sequentiallogic.com/2009/05/29/maxmind-geolite-country-and-geolite-city-made-easy/</link>
	<description>Where software engineering meets online marketing</description>
	<lastBuildDate>Tue, 03 Jan 2012 15:32:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Shantanu</title>
		<link>http://www.sequentiallogic.com/2009/05/29/maxmind-geolite-country-and-geolite-city-made-easy/comment-page-1/#comment-18238</link>
		<dc:creator>Shantanu</dc:creator>
		<pubDate>Tue, 03 Jan 2012 15:32:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.sequentiallogic.com/?p=105#comment-18238</guid>
		<description>require_once(JPATH_SITE .DS.&#039;components/com_quickregistration/goip/geoipcity.inc&#039;);&lt;br&gt;$gi = geoip_open(JPATH_SITE .DS.&#039;components/com_quickregistration/goip/GeoLiteCity.dat&#039;, GEOIP_STANDARD);&lt;br&gt;$location = GeoIP_record_by_addr($gi, $_SERVER[&#039;REMOTE_ADDR&#039;]);&lt;br&gt;geoip_close($gi);&lt;br&gt;echo &#039;&lt;pre&gt;&#039;;&lt;br&gt;print_r($location);&lt;br&gt;echo &#039;&lt;/pre&gt;&#039;;&lt;br&gt;&lt;br&gt;This is my code but its not working. I have done this code on my local site and its working fine but when I put this on ly live site its not working.&lt;br&gt;&lt;br&gt;What to do for this?</description>
		<content:encoded><![CDATA[<p>require_once(JPATH_SITE .DS.&#39;components/com_quickregistration/goip/geoipcity.inc&#39;);<br />$gi = geoip_open(JPATH_SITE .DS.&#39;components/com_quickregistration/goip/GeoLiteCity.dat&#39;, GEOIP_STANDARD);<br />$location = GeoIP_record_by_addr($gi, $_SERVER[&#39;REMOTE_ADDR&#39;]);<br />geoip_close($gi);<br />echo &#39;
<pre>&#39;;print_r($location);echo &#39;</pre>
<p>&#39;;</p>
<p>This is my code but its not working. I have done this code on my local site and its working fine but when I put this on ly live site its not working.</p>
<p>What to do for this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yas</title>
		<link>http://www.sequentiallogic.com/2009/05/29/maxmind-geolite-country-and-geolite-city-made-easy/comment-page-1/#comment-18227</link>
		<dc:creator>Yas</dc:creator>
		<pubDate>Sat, 05 Feb 2011 01:39:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.sequentiallogic.com/?p=105#comment-18227</guid>
		<description>Type your commen&lt;br&gt;MaxMind GeoLite Country and GeoLite City Made Easy&lt;br&gt;May 29th, 2009, Author: emile, Categories: Affiliate Marketing, GeoIP, Software&lt;br&gt;&lt;br&gt;Some consumers are up in arms because that fake blog they read by someone who just happens to be from the same city they live in, turns out to be a bit phony. They&#039;re surprised to find out that a piece of software is behind the trick, which does a GeoIP lookup on their IP address, and then uses that within the text of the splog, or ad, making the reader feel a bit more of a connection to the ad copy.&lt;br&gt;&lt;br&gt;Even before these splogs popped up, I had been interested in GeoIP lookup techniques for Google Maps mashup purposes, but the splog trick finally made me figure out how it was done.&lt;br&gt;&lt;br&gt;DISCLAIMER: I don&#039;t condone the use of these techniques for deceptive advertising techniques. At best, they are disingenuous, and at worst, may be illegal, according to the FTC. Like The Force, this technique can be used for good or evil. Which path you choose is up to you.&lt;br&gt;&lt;br&gt;MaxMind has a paid GeoIP City database service that costs $370 up front and $90 a month for database updates, which they advertise as 99.8% accurate in determining location from IP address. However, they also make a free database available, that is 99.5% accurate. We&#039;ll cover the free version since the accuracy difference is negligible for our purposes.&lt;br&gt;&lt;br&gt;The crucial information is spread out over four pages on the MaxMind site:&lt;br&gt;&lt;br&gt;APIs for GeoIP products&lt;br&gt;GeoLite Country information&lt;br&gt;GeoLite City information&lt;br&gt;and our API of choice, the GeoIP PHP API&lt;br&gt;&lt;br&gt;It should be noted that the GeoIP PHP API has three methods of being implemented, each being more efficient with webserver resources than the previous: a pure PHP module, a PECL module that allows you to embed the GeoIP C Library inside PHP, and mod_geoip, an Apache module that you can access via PHP. Since our needs are fairly minimal, we&#039;ll go with the easiest to implement, the pure PHP module, which requires no PHP or Apache changes.&lt;br&gt;&lt;br&gt;1) Download the following PHP files from MaxMind: geoipcity.inc, geoip.inc, and geoipregionvars.php .&lt;br&gt;&lt;br&gt;2) Download the latest GeoLite City Binary Format file, which is updated on the 1st of each month, and gunzip it.&lt;br&gt;&lt;br&gt;3) Put all of those files in their own directory somewhere on your webserver, and for this example, we&#039;ll name the directory GeoIP.&lt;br&gt;&lt;br&gt;4) Put the following code in a web-accessible PHP page, changing the PATH/TO parts to match your setup, and view the page in a web browser:&lt;br&gt;PLAIN TEXT&lt;br&gt;PHP:&lt;br&gt;&lt;br&gt;   1.&lt;br&gt;         2.&lt;br&gt;      require_once(&#039;/PATH/TO/GeoIP/geoipcity.inc&#039;);&lt;br&gt;   3.&lt;br&gt;      $gi = geoip_open(&#039;/PATH/TO/GeoIP/GeoLiteCity.dat&#039;, GEOIP_STANDARD);&lt;br&gt;   4.&lt;br&gt;      $location = GeoIP_record_by_addr($gi, $_SERVER[&#039;REMOTE_ADDR&#039;]);&lt;br&gt;   5.&lt;br&gt;      geoip_close($gi);&lt;br&gt;   6.&lt;br&gt;       &lt;br&gt;   7.&lt;br&gt;      echo &#039;&lt;pre&gt;&#039;;&lt;br&gt;   8.&lt;br&gt;      print_r($location);&lt;br&gt;   9.&lt;br&gt;      echo &#039;&lt;/pre&gt;&#039;;&lt;br&gt;  10.&lt;br&gt;      ?&gt;&lt;br&gt;  11.&lt;br&gt;       &lt;br&gt;  12.&lt;br&gt;      I believe you are in city ?&gt;, region ?&gt;&lt;br&gt;&lt;br&gt;The database says I&#039;m in Los Angeles when in fact we&#039;re in Mission Viejo (Orange County), which isn&#039;t a huge deal, but shows the possible slight inaccuracy in IP-&gt;location lookup.&lt;br&gt;&lt;br&gt;One thing this could benefit from is a quick state abbreviation to full state name conversion function, so the text would be &quot;Los Angeles, California&quot; instead of &quot;Los Angeles, CA&quot;. I think the full spelling looks more natural in some instances. I&#039;ve uploaded a PHP state abbreviation to state name conversion function for your use.&lt;br&gt;&lt;br&gt;Update: Danger Brown steals the show for GeoIP made REALLY easy. He&#039;s got a two line javascript snippet that does the same thing, but is reliant on the MaxMind servers each time the script is called. My experience with using javascript that is resident on outside servers is that it works great until it doesn&#039;t. One day your site will be slow or completely down because the outside javascript is failing to load. Some well crafted code can mitigate the risk, but I prefer to have all executing code on my server. Except for Google Analytics, because I tend to be no match for their servers.&lt;br&gt;&lt;br&gt;Update 2: I&#039;ve uploaded my modified geoipcity.inc that includes the abbreviation to state/province function, with ON-&gt;Ontario included, and the call to that function in GeoIP_record_by_addr. Note that I could have also put the $record-&gt;region_name = Abbreviation_GetStateName($record-&gt;region); code within the _get_record function, but I chose to put it in the higher-level GeoIP_record_by_addr function.&lt;br&gt;&lt;br&gt;Update 3: &lt;a href=&quot;http://SEOcracy.com&quot; rel=&quot;nofollow&quot;&gt;SEOcracy.com&lt;/a&gt; has a post about a very simple way to use the Google javascript API to do geolocation&lt;br&gt;DISQUS...&lt;br&gt;Like Dislike&lt;br&gt;&lt;br&gt;    *&lt;br&gt;&lt;br&gt;	Community 	&lt;br&gt;Disqus&lt;br&gt;&lt;br&gt;    * Login&lt;br&gt;    * About Disqus&lt;br&gt;&lt;br&gt;Glad you liked it. Would you like to share?&lt;br&gt;&lt;br&gt;Facebook&lt;br&gt;&lt;br&gt;Twitter&lt;br&gt;&lt;br&gt;    * Share&lt;br&gt;    * No thanks&lt;br&gt;&lt;br&gt;Sharing this page …&lt;br&gt;&lt;br&gt;Thanks! Close&lt;br&gt;Add New Commentt here.</description>
		<content:encoded><![CDATA[<p>Type your commen<br />MaxMind GeoLite Country and GeoLite City Made Easy<br />May 29th, 2009, Author: emile, Categories: Affiliate Marketing, GeoIP, Software</p>
<p>Some consumers are up in arms because that fake blog they read by someone who just happens to be from the same city they live in, turns out to be a bit phony. They&#39;re surprised to find out that a piece of software is behind the trick, which does a GeoIP lookup on their IP address, and then uses that within the text of the splog, or ad, making the reader feel a bit more of a connection to the ad copy.</p>
<p>Even before these splogs popped up, I had been interested in GeoIP lookup techniques for Google Maps mashup purposes, but the splog trick finally made me figure out how it was done.</p>
<p>DISCLAIMER: I don&#39;t condone the use of these techniques for deceptive advertising techniques. At best, they are disingenuous, and at worst, may be illegal, according to the FTC. Like The Force, this technique can be used for good or evil. Which path you choose is up to you.</p>
<p>MaxMind has a paid GeoIP City database service that costs $370 up front and $90 a month for database updates, which they advertise as 99.8% accurate in determining location from IP address. However, they also make a free database available, that is 99.5% accurate. We&#39;ll cover the free version since the accuracy difference is negligible for our purposes.</p>
<p>The crucial information is spread out over four pages on the MaxMind site:</p>
<p>APIs for GeoIP products<br />GeoLite Country information<br />GeoLite City information<br />and our API of choice, the GeoIP PHP API</p>
<p>It should be noted that the GeoIP PHP API has three methods of being implemented, each being more efficient with webserver resources than the previous: a pure PHP module, a PECL module that allows you to embed the GeoIP C Library inside PHP, and mod_geoip, an Apache module that you can access via PHP. Since our needs are fairly minimal, we&#39;ll go with the easiest to implement, the pure PHP module, which requires no PHP or Apache changes.</p>
<p>1) Download the following PHP files from MaxMind: geoipcity.inc, geoip.inc, and geoipregionvars.php .</p>
<p>2) Download the latest GeoLite City Binary Format file, which is updated on the 1st of each month, and gunzip it.</p>
<p>3) Put all of those files in their own directory somewhere on your webserver, and for this example, we&#39;ll name the directory GeoIP.</p>
<p>4) Put the following code in a web-accessible PHP page, changing the PATH/TO parts to match your setup, and view the page in a web browser:<br />PLAIN TEXT<br />PHP:</p>
<p>   1.<br />         2.<br />      require_once(&#39;/PATH/TO/GeoIP/geoipcity.inc&#39;);<br />   3.<br />      $gi = geoip_open(&#39;/PATH/TO/GeoIP/GeoLiteCity.dat&#39;, GEOIP_STANDARD);<br />   4.<br />      $location = GeoIP_record_by_addr($gi, $_SERVER[&#39;REMOTE_ADDR&#39;]);<br />   5.<br />      geoip_close($gi);<br />   6.</p>
<p>   7.<br />      echo &#39;
<pre>&#39;;   8.      print_r($location);   9.      echo &#39;</pre>
<p>&#39;;<br />  10.<br />      ?&gt;<br />  11.</p>
<p>  12.<br />      I believe you are in city ?&gt;, region ?&gt;</p>
<p>The database says I&#39;m in Los Angeles when in fact we&#39;re in Mission Viejo (Orange County), which isn&#39;t a huge deal, but shows the possible slight inaccuracy in IP-&gt;location lookup.</p>
<p>One thing this could benefit from is a quick state abbreviation to full state name conversion function, so the text would be &#8220;Los Angeles, California&#8221; instead of &#8220;Los Angeles, CA&#8221;. I think the full spelling looks more natural in some instances. I&#39;ve uploaded a PHP state abbreviation to state name conversion function for your use.</p>
<p>Update: Danger Brown steals the show for GeoIP made REALLY easy. He&#39;s got a two line javascript snippet that does the same thing, but is reliant on the MaxMind servers each time the script is called. My experience with using javascript that is resident on outside servers is that it works great until it doesn&#39;t. One day your site will be slow or completely down because the outside javascript is failing to load. Some well crafted code can mitigate the risk, but I prefer to have all executing code on my server. Except for Google Analytics, because I tend to be no match for their servers.</p>
<p>Update 2: I&#39;ve uploaded my modified geoipcity.inc that includes the abbreviation to state/province function, with ON-&gt;Ontario included, and the call to that function in GeoIP_record_by_addr. Note that I could have also put the $record-&gt;region_name = Abbreviation_GetStateName($record-&gt;region); code within the _get_record function, but I chose to put it in the higher-level GeoIP_record_by_addr function.</p>
<p>Update 3: <a href="http://SEOcracy.com" rel="nofollow">SEOcracy.com</a> has a post about a very simple way to use the Google javascript API to do geolocation<br />DISQUS&#8230;<br />Like Dislike</p>
<p>    *</p>
<p>	Community 	<br />Disqus</p>
<p>    * Login<br />    * About Disqus</p>
<p>Glad you liked it. Would you like to share?</p>
<p>Facebook</p>
<p>Twitter</p>
<p>    * Share<br />    * No thanks</p>
<p>Sharing this page …</p>
<p>Thanks! Close<br />Add New Commentt here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jacob Seiner</title>
		<link>http://www.sequentiallogic.com/2009/05/29/maxmind-geolite-country-and-geolite-city-made-easy/comment-page-1/#comment-18212</link>
		<dc:creator>Jacob Seiner</dc:creator>
		<pubDate>Thu, 11 Feb 2010 23:51:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.sequentiallogic.com/?p=105#comment-18212</guid>
		<description>Rather than use GeoIP PHP API, I went with the Apache module. It&#039;s not difficult to install and I&#039;ve written a couple tutorials on how to set it up:&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.netdip.com/maxmind-mod-geoip-geolite-city-debian-8u/&quot; rel=&quot;nofollow&quot;&gt;http://www.netdip.com/maxmind-mod-geoip-geolite...&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.netdip.com/installing-the-maxmind-geolite-city-binary-database-and-the-mod-geoip-module-for-apache2-on-ubuntu-linux-2s/&quot; rel=&quot;nofollow&quot;&gt;http://www.netdip.com/installing-the-maxmind-ge...&lt;/a&gt;&lt;br&gt;&lt;br&gt;There are a couple advantages to using the Apache module for MaxMind.&lt;br&gt;&lt;br&gt;The first reason is that the Apache module can perform lookups much faster and with less resource usage than with the PHP API. Although, as you mentioned, this performance advantage may not be needed in some applications.&lt;br&gt;&lt;br&gt;The second reason I prefer the MaxMind Apache module is that it requires less code to perform the same function as the PHP API. For example, here&#039;s how you could echo a visitor&#039;s city and region using PHP when the MaxMind Apache module is loaded:&lt;br&gt;&lt;br&gt;&lt;?php&lt;br&gt;echo &#039;I believe you are in &#039;.apache_note(&quot;GEOIP_CITY&quot;).&#039;, &#039;.apache_note(&quot;GEOIP_REGION&quot;);&lt;br&gt;?&gt;&lt;br&gt;&lt;br&gt;That&#039;s really all there is to do it, just three lines of code, including the php opening and closing tags. As you can see, with the MaxMind Apache module there&#039;s no need to be concerned with the extra stuff needed when using the PHP API. That&#039;s what works for me ;)</description>
		<content:encoded><![CDATA[<p>Rather than use GeoIP PHP API, I went with the Apache module. It&#39;s not difficult to install and I&#39;ve written a couple tutorials on how to set it up:</p>
<p><a href="http://www.netdip.com/maxmind-mod-geoip-geolite-city-debian-8u/" rel="nofollow"></a><a href="http://www.netdip.com/maxmind-mod-geoip-geolite.." rel="nofollow">http://www.netdip.com/maxmind-mod-geoip-geolite..</a>.<br /><a href="http://www.netdip.com/installing-the-maxmind-geolite-city-binary-database-and-the-mod-geoip-module-for-apache2-on-ubuntu-linux-2s/" rel="nofollow"></a><a href="http://www.netdip.com/installing-the-maxmind-ge.." rel="nofollow">http://www.netdip.com/installing-the-maxmind-ge..</a>.</p>
<p>There are a couple advantages to using the Apache module for MaxMind.</p>
<p>The first reason is that the Apache module can perform lookups much faster and with less resource usage than with the PHP API. Although, as you mentioned, this performance advantage may not be needed in some applications.</p>
<p>The second reason I prefer the MaxMind Apache module is that it requires less code to perform the same function as the PHP API. For example, here&#39;s how you could echo a visitor&#39;s city and region using PHP when the MaxMind Apache module is loaded:</p>
<p>&lt;?php<br />echo &#39;I believe you are in &#39;.apache_note(&#8220;GEOIP_CITY&#8221;).&#39;, &#39;.apache_note(&#8220;GEOIP_REGION&#8221;);<br />?&gt;</p>
<p>That&#39;s really all there is to do it, just three lines of code, including the php opening and closing tags. As you can see, with the MaxMind Apache module there&#39;s no need to be concerned with the extra stuff needed when using the PHP API. That&#39;s what works for me ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sonny</title>
		<link>http://www.sequentiallogic.com/2009/05/29/maxmind-geolite-country-and-geolite-city-made-easy/comment-page-1/#comment-16785</link>
		<dc:creator>Sonny</dc:creator>
		<pubDate>Sat, 25 Jul 2009 00:41:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.sequentiallogic.com/?p=105#comment-16785</guid>
		<description>Got it

Just change this line in the code above
$location = GeoIP_record_by_addr($gi, $_SERVER[&#039;REMOTE_ADDR&#039;]);

To

$location = GeoIP_record_by_addr($gi, $_GET[&quot;ipaddr&quot;]);

You can link direct with something like this
.php?ipaddr=123.456.789

Or you can use any form with &quot;GET&quot; and a field named ipaddr etc.

This tread has helped me a lot at learning this stuff.</description>
		<content:encoded><![CDATA[<p>Got it</p>
<p>Just change this line in the code above<br />
$location = GeoIP_record_by_addr($gi, $_SERVER['REMOTE_ADDR']);</p>
<p>To</p>
<p>$location = GeoIP_record_by_addr($gi, $_GET["ipaddr"]);</p>
<p>You can link direct with something like this<br />
.php?ipaddr=123.456.789</p>
<p>Or you can use any form with &#8220;GET&#8221; and a field named ipaddr etc.</p>
<p>This tread has helped me a lot at learning this stuff.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sonny</title>
		<link>http://www.sequentiallogic.com/2009/05/29/maxmind-geolite-country-and-geolite-city-made-easy/comment-page-1/#comment-16781</link>
		<dc:creator>Sonny</dc:creator>
		<pubDate>Fri, 24 Jul 2009 20:42:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.sequentiallogic.com/?p=105#comment-16781</guid>
		<description>Hi Emile

I have been trying to create a simple no frills (form php page) based off of the code above to lookup a ip address using the GeoIPCity.dat, if you have one, or if you get time one day can you post a crude example of one?

Thanks
Sonny</description>
		<content:encoded><![CDATA[<p>Hi Emile</p>
<p>I have been trying to create a simple no frills (form php page) based off of the code above to lookup a ip address using the GeoIPCity.dat, if you have one, or if you get time one day can you post a crude example of one?</p>
<p>Thanks<br />
Sonny</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sonny</title>
		<link>http://www.sequentiallogic.com/2009/05/29/maxmind-geolite-country-and-geolite-city-made-easy/comment-page-1/#comment-16679</link>
		<dc:creator>Sonny</dc:creator>
		<pubDate>Fri, 17 Jul 2009 20:02:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.sequentiallogic.com/?p=105#comment-16679</guid>
		<description>That is great, I figured out how to enter a IP direct, I was so stupid sorry about that

your State name function opens a lot of possibility other then just the full name &quot;like welcome to my State etc you can do a ton of stuff with that function, someone could even add to it if needed

this is a very informational thread on this kind of stuff

that else statement is a very important fall back default to have just in case a abv is wrong or something etc, because its impossible to edit all things related to this world

I&#039;ll check back often, if you come up with anything else one day please post it, If I come across cool code related to this I will let you know.

Thanks
Sonny</description>
		<content:encoded><![CDATA[<p>That is great, I figured out how to enter a IP direct, I was so stupid sorry about that</p>
<p>your State name function opens a lot of possibility other then just the full name &#8220;like welcome to my State etc you can do a ton of stuff with that function, someone could even add to it if needed</p>
<p>this is a very informational thread on this kind of stuff</p>
<p>that else statement is a very important fall back default to have just in case a abv is wrong or something etc, because its impossible to edit all things related to this world</p>
<p>I&#8217;ll check back often, if you come up with anything else one day please post it, If I come across cool code related to this I will let you know.</p>
<p>Thanks<br />
Sonny</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Emile</title>
		<link>http://www.sequentiallogic.com/2009/05/29/maxmind-geolite-country-and-geolite-city-made-easy/comment-page-1/#comment-16678</link>
		<dc:creator>Emile</dc:creator>
		<pubDate>Fri, 17 Jul 2009 18:57:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.sequentiallogic.com/?p=105#comment-16678</guid>
		<description>@Sonny To test a different IP address, replace $_SERVER[&#039;REMOTE_ADDR&#039;] with the IP address in quotes, i.e. &#039;xxx.xxx.xxx.xxx&#039; . I&#039;ve tried several random IP addresses, and many of them return blank or a random number for either city or region. This is a limitation of the Geo_IP library.

For those regions that are not in the switch statement in geoipcity.inc, the region_name will not be filled in, so it will print nothing for region_name. You&#039;d need to find out what region abbreviations the Geo_IP library is capable of returning, and put in a case statement for each one to make this a complete solution.

For now, to avoid printing out nothing for empty region_names, I would do something like this:

I believe you are in &lt;?php echo $location-&gt;city ?&gt;, &lt;?php if($location-&gt;region_name){echo $location-&gt;region_name;} else {echo $location-&gt;region;} ?&gt;

This will print the region _name if it is filled in, otherwise it will print the abbreviated region.</description>
		<content:encoded><![CDATA[<p>@Sonny To test a different IP address, replace $_SERVER['REMOTE_ADDR'] with the IP address in quotes, i.e. &#8216;xxx.xxx.xxx.xxx&#8217; . I&#8217;ve tried several random IP addresses, and many of them return blank or a random number for either city or region. This is a limitation of the Geo_IP library.</p>
<p>For those regions that are not in the switch statement in geoipcity.inc, the region_name will not be filled in, so it will print nothing for region_name. You&#8217;d need to find out what region abbreviations the Geo_IP library is capable of returning, and put in a case statement for each one to make this a complete solution.</p>
<p>For now, to avoid printing out nothing for empty region_names, I would do something like this:</p>
<p>I believe you are in < ?php echo $location->city ?>, < ?php if($location->region_name){echo $location->region_name;} else {echo $location->region;} ?></p>
<p>This will print the region _name if it is filled in, otherwise it will print the abbreviated region.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sonny</title>
		<link>http://www.sequentiallogic.com/2009/05/29/maxmind-geolite-country-and-geolite-city-made-easy/comment-page-1/#comment-16677</link>
		<dc:creator>Sonny</dc:creator>
		<pubDate>Fri, 17 Jul 2009 18:07:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.sequentiallogic.com/?p=105#comment-16677</guid>
		<description>Was just thinking about this

Will that modified geoipcity.inc file effect reading locations for those outside the US?

or will it just fall back to the default regions for those outside the US and not detected?

(Where exactly in the line below do I enter a IP to test)
$location = GeoIP_record_by_addr($gi, $_SERVER[&#039;REMOTE_ADDR&#039;]);

I used to use this before I changed over to your way they both do the same but appear to be very different, any one way better then the other?
region. &quot;, &quot; .$rsGeoData-&gt;country_name) ?&gt;

Thanks
Sonny</description>
		<content:encoded><![CDATA[<p>Was just thinking about this</p>
<p>Will that modified geoipcity.inc file effect reading locations for those outside the US?</p>
<p>or will it just fall back to the default regions for those outside the US and not detected?</p>
<p>(Where exactly in the line below do I enter a IP to test)<br />
$location = GeoIP_record_by_addr($gi, $_SERVER['REMOTE_ADDR']);</p>
<p>I used to use this before I changed over to your way they both do the same but appear to be very different, any one way better then the other?<br />
region. &#8220;, &#8221; .$rsGeoData-&gt;country_name) ?&gt;</p>
<p>Thanks<br />
Sonny</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Emile</title>
		<link>http://www.sequentiallogic.com/2009/05/29/maxmind-geolite-country-and-geolite-city-made-easy/comment-page-1/#comment-16676</link>
		<dc:creator>Emile</dc:creator>
		<pubDate>Fri, 17 Jul 2009 17:37:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.sequentiallogic.com/?p=105#comment-16676</guid>
		<description>@Sonny Excellent, glad it works now. Thanks for also helping me find the NH/NJ bug, I guess it&#039;s fortunate you are in New Jersey, or we wouldn&#039;t have found it! I think that was what was causing you the Unknown State issue, it couldn&#039;t find a case for NJ (since I had NH twice), and it went with the default Unknown State.</description>
		<content:encoded><![CDATA[<p>@Sonny Excellent, glad it works now. Thanks for also helping me find the NH/NJ bug, I guess it&#8217;s fortunate you are in New Jersey, or we wouldn&#8217;t have found it! I think that was what was causing you the Unknown State issue, it couldn&#8217;t find a case for NJ (since I had NH twice), and it went with the default Unknown State.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sonny</title>
		<link>http://www.sequentiallogic.com/2009/05/29/maxmind-geolite-country-and-geolite-city-made-easy/comment-page-1/#comment-16675</link>
		<dc:creator>Sonny</dc:creator>
		<pubDate>Fri, 17 Jul 2009 17:30:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.sequentiallogic.com/?p=105#comment-16675</guid>
		<description>Yes It works now, I downloaded your geoipcity.inc file again. thanks for helping your a really nice person

Sonny

PS the full State name is so much nicer to have, I do not know why they just don&#039;t build that in.</description>
		<content:encoded><![CDATA[<p>Yes It works now, I downloaded your geoipcity.inc file again. thanks for helping your a really nice person</p>
<p>Sonny</p>
<p>PS the full State name is so much nicer to have, I do not know why they just don&#8217;t build that in.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

