Oke, Go here :
http://www.ip2nation.com/
you can download there database of ip adresses.
They even got an few examples of php mysql scripting.
I use it myself so i don't depend on sponsor programms.
Befor i used this on my sites I used an browser tracking script i wrote but you can't realy trust an users browser...
Ip tracking is the best way!
Example script:
PHP Code:
<?php
$server = ""; // MySQL hostname
$username = ""; // MySQL username
$password = ""; // MySQL password
$dbname = ""; // MySQL db name
$db = mysql_connect($server, $username, $password) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$sql = "SELECT
country
FROM
ip2nation
WHERE
ip < INET_ATON('".$_SERVER['REMOTE_ADDR']."')
ORDER BY
ip DESC
LIMIT 0,1";
$country = mysql_result(mysql_query($sql), 0, 0);
// Redirect users based on their country
switch ($country) {
case 'en':
echo"<hahahahahahahahalocation.href=('http://www.yourpaysite.com');</hahahahahahahaha";
break;
default:
echo"<hahahahahahahahalocation.href=('http://www.yourdefaultsite.com');</hahahahahahahaha";
}
?>