Get Country, City of Visitors Easy with PHP 5

This is full code for PHP

// Author:
// remember chmod 0777 for folder 'cache'
$file = "./cache/".$ip;
if(!file_exists($file)) {
    // request
    $json = file_get_contents("".$ip."&full=true");
    $f = fopen($file,"w+");
} else {
    $json = file_get_contents($file);

$json = json_decode($json,true);
echo "<pre>";


You can check demo here: [Link To Demo]

You can use this script to detect spammer, or verify order in shopping cart online, detect IP & Proxy …

Gets my region wrong.

Gets my region right.

Hope the site is going to be stable.

That is getting the location of the ISP or proxy server - not the location of your visitor. Your visitor could be on the opposite side of the world.

PHP Only detect IP by REMOTE_ADDR, in case your visitors use proxy, I have no idea how to check proxy and real ip.