<?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>Fri, 13 Aug 2010 01:12:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<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>
	<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-16674</link>
		<dc:creator>Emile</dc:creator>
		<pubDate>Fri, 17 Jul 2009 17:19:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.sequentiallogic.com/?p=105#comment-16674</guid>
		<description>@Sonny The problem is somewhere in the Abbreviation_GetStateName function, because it is returning a value (Unknown State), it&#039;s just the wrong value. If &#039;NJ&#039; is truly being passed into the function, it should be returning New Jersey.

Try this; in the GeoIP_record_by_addr function, put this code just below the line $record = _get_record($gi, $ipnum);

echo &#039;The abbreviation is: &#039;.$record-&gt;region;
exit;

This should print out &#039;The abbreviation is NJ&#039; .</description>
		<content:encoded><![CDATA[<p>@Sonny The problem is somewhere in the Abbreviation_GetStateName function, because it is returning a value (Unknown State), it&#8217;s just the wrong value. If &#8216;NJ&#8217; is truly being passed into the function, it should be returning New Jersey.</p>
<p>Try this; in the GeoIP_record_by_addr function, put this code just below the line $record = _get_record($gi, $ipnum);</p>
<p>echo &#8216;The abbreviation is: &#8216;.$record->region;<br />
exit;</p>
<p>This should print out &#8216;The abbreviation is NJ&#8217; .</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-16673</link>
		<dc:creator>Sonny</dc:creator>
		<pubDate>Fri, 17 Jul 2009 17:16:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.sequentiallogic.com/?p=105#comment-16673</guid>
		<description>That is correct

When I change your line
$record-&gt;region_name = Abbreviation_GetStateName(’NJ’);

I still got Unknown State, I will download your mod geoippcity inc file again right now

Thanks I put the ip in place of REMOTE_ADDR
[&#039;REMOTE_ADDR&#039;]

Thanks
Sonny</description>
		<content:encoded><![CDATA[<p>That is correct</p>
<p>When I change your line<br />
$record-&gt;region_name = Abbreviation_GetStateName(’NJ’);</p>
<p>I still got Unknown State, I will download your mod geoippcity inc file again right now</p>
<p>Thanks I put the ip in place of REMOTE_ADDR<br />
['REMOTE_ADDR']</p>
<p>Thanks<br />
Sonny</p>
]]></content:encoded>
	</item>
</channel>
</rss>
