/****************************************************************************************************************/ /* Description: This snippet is provide simple way to redirect visitor to different default web page based on */ /* visitor's country of origin */ /* suggestions for different city locations across the country. */ /* There are 1 steps in this snippet. For information, please visit IP2Location tutorial page at: */ /* https://www.ip2location.com/tutorials/redirect-web-visitors-by-country-using-php-and-mysql-database */ /****************************************************************************************************************/ /* You can obtain free IP Country database for IPv4 at https://lite.ip2location.com/database/ip-country */
'; exit; // Function to convert IP address (xxx.xxx.xxx.xxx) to IP number (0 to 256^4-1) function Dot2LongIP ($IPaddr) { if ($IPaddr == "") { return 0; } else { $ips = explode(".", $IPaddr); return ($ips[3] + $ips[2] * 256 + $ips[1] * 256 * 256 + $ips[0] * 256 * 256 * 256); } } ?>