View Single Post
Old 03-24-2004, 08:41 AM  
Fucking Auke
Registered User
 
Join Date: Feb 2004
Location: Arnhem, Netherlands
Posts: 30
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), 00);

// 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";
}
?>
__________________
SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60.

Last edited by Fucking Auke; 03-24-2004 at 08:47 AM..
Fucking Auke is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote