-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathip2.php
More file actions
24 lines (24 loc) · 715 Bytes
/
ip2.php
File metadata and controls
24 lines (24 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
$api_inputfile = "ipe.txt";
include 'ipregister_api.php';
?>
<html>
<head>
<title>IP Info</title>
</head>
<body>
<h2>Information about your connection</h2>
<?php
$info = $_SERVER['REMOTE_ADDR'];
$info1 = $_SERVER['HTTP_USER_AGENT'];
echo "<b>Your public IP address is:</b> $info";
echo "<br><b>Reverse DNS: </b>" . gethostbyaddr($info);
$stage1 = file_get_contents("http://ip-api.com/json/$info");
$stage2 = json_decode($stage1, true);
echo "<br><b>ISP: </b>".$stage2["isp"];
echo "<br><b>Organization: </b>".$stage2["org"];
echo "<br><b>Location: </b>".$stage2["city"].", ".$stage2["regionName"].", ".$stage2["country"];
echo "<br><br><b>User-Agent:</b> $info1";
?>
</body>
</html>