-
Notifications
You must be signed in to change notification settings - Fork 1
/
ip.php
39 lines (35 loc) · 994 Bytes
/
ip.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
$ip = get_real_ip();
$locale = @file("http://api.hostip.info/get_html.php?ip=".$ip . "&position=true");
function get_real_ip()
{
if (isset($_SERVER["HTTP_CLIENT_IP"]))
{
return $_SERVER["HTTP_CLIENT_IP"];
}
elseif (isset($_SERVER["HTTP_X_FORWARDED_FOR"]))
{
return $_SERVER["HTTP_X_FORWARDED_FOR"];
}
elseif (isset($_SERVER["HTTP_X_FORWARDED"]))
{
return $_SERVER["HTTP_X_FORWARDED"];
}
elseif (isset($_SERVER["HTTP_FORWARDED_FOR"]))
{
return $_SERVER["HTTP_FORWARDED_FOR"];
}
elseif (isset($_SERVER["HTTP_FORWARDED"]))
{
return $_SERVER["HTTP_FORWARDED"];
}
else
{
return $_SERVER["REMOTE_ADDR"];
}
}
?>
<p>Your Public IP: <?php echo $_SERVER["REMOTE_ADDR"]; ?></p>
<p>Your Real IP: <?php echo $ip; ?></p>
<p><?php echo $locale['0']; ?></p>
<img src="http://api.hostip.info/flag.php?ip=<?php echo $ip; ?>" border="0"><br/>