Skip to content

Instantly share code, notes, and snippets.

@akmandev
Created October 19, 2015 01:47
Show Gist options
  • Save akmandev/8f2ee87090baca8f0a9f to your computer and use it in GitHub Desktop.
Save akmandev/8f2ee87090baca8f0a9f to your computer and use it in GitHub Desktop.
<?php
$userIP = $_SERVER['REMOTE_ADDR'];
//$userIP = '78.179.207.153';
$ipToGeo = file_get_contents('http://www.telize.com/geoip/'. $userIP);
$ipToGeo = json_decode($ipToGeo);
$userCountry = $ipToGeo->country;
?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Kullanıcı Bilgileri</title>
</head>
<body>
<h3>Kullanıcı IPsi</h3>
<?php echo $userIP?>
<br><br>
<h3>Ülke</h3>
<?php echo $userCountry?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment