Difference between revisions of "GeoIP"
From TMM Wiki
Jump to navigationJump to searchTMMStephenY (talk | contribs) |
|||
Line 22: | Line 22: | ||
?> | ?> | ||
</pre> | </pre> | ||
+ | <br> | ||
+ | '''Note: Please be sure to perform this test after you install or update Maxmind's GeoIP. | ||
== See Also == | == See Also == |
Revision as of 20:06, 10 April 2014
Download and install GeoIP from Maxmind. Please ensure that you install the Apache Module for GeoIP, as this will not work without the GeoIP Apache API installed.
Configure and test GeoIP, then find the nats/includes folder on your server, open the config.php file, and enter the following:
$config['IP_FILTER'] = 'GEOIP';
You can put it anywhere in the file except for after the last line.
Test Code
The following PHP code will help you test GeoIP. Put it in a file, put the file on your webserver, and load its URL. It should print your country's name.
<? echo 'You are from '.apache_note("GEOIP_COUNTRY_NAME"); ?>
Note: Please be sure to perform this test after you install or update Maxmind's GeoIP.