Hi I found this code and do as it should but I just code as to add my website
Well first you need to download the GeoLite Country database in binary format http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz. Next, upload it to your server. Afterward, download the http://geolite.maxmind.com/download/geoip/api/php/geoip.inc file and save it on your server as well.
Finally, in your application, use the code below (you can modify it):
<?php include("/home/new/public_html/geoip.inc"); //open the database $GeoIPDatabase = geoip_open("/home/new/public_html/GeoIP.dat", GEOIP_STANDARD); //to get the country code (2 letters) geoip_country_code_by_addr($GeoIPDatabase, $IP); //to get the full country name geoip_country_name_by_addr($GeoIPDatabase, $IP); //close the database geoip_close($GeoIPDatabase); ?>
Code works but now I need to incorporate code to do what I need
For example, if you're from germany you open the page 2, but if you're from Italy to open a page 3.
Something if and else but I do not know how to do it.
Thank you very much for the help