So after searching high and low, I found a free script that provides a way to redirect users based on geographical region of visitors to our site.
Here is the site:
http://www.ip2nation.com/ip2nation However, I'm having some trouble implimenting it on my site.
I downloaded and added their database file. Then I manipulated their redirect script:
$sql = 'SELECT
country
FROM
ip2nation
WHERE
ip < INET_ATON("'.$_SERVER['REMOTE_ADDR'].'")
ORDER BY
ip DESC
LIMIT 0,1';
list($country) = mysql_fetch_row(mysql_query($sql));
switch ($country) {
case 'br':
// Get the brazilians to a portuguese version of yoursite
header('Location: http://www.yoursite.com/?l=portuguese');
exit;
default:
// The rest can go to the engish version
header('Location: http://www.yoursite.com/?l=english');
exit;
}
and I added this code to the end of this file: includes/page_header.php.
Now, when I enter my site, it says something that the redirect limit has exceeded...am I doing this right? should I put this bit of info in our sessions.php file? if so, can someone help guide me...i really want this and think it's very useful for a lot of users here who use multilanguage feature of 4images.