Compare commits
6 Commits
cfd00db3ab
...
90be3e54b9
| Author | SHA1 | Date | |
|---|---|---|---|
|
90be3e54b9
|
|||
|
69c1411c98
|
|||
|
504586a033
|
|||
|
a720d581d5
|
|||
|
e5f6c39224
|
|||
|
6cf4ef1237
|
BIN
favicon.png
Normal file
BIN
favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
20
index.php
20
index.php
@@ -24,6 +24,7 @@ if($method === "simple") { // simple
|
||||
exit;
|
||||
} elseif($method === "myself" ) { // detailed info about own IP
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
print_header();
|
||||
show_http_headers();
|
||||
show_hostname($ip);
|
||||
show_reverse($hostname);
|
||||
@@ -31,12 +32,14 @@ if($method === "simple") { // simple
|
||||
show_whois($ip);
|
||||
} elseif($method === "ip" ) { // detailed info an IP
|
||||
$ip = $t;
|
||||
print_header();
|
||||
show_hostname($ip);
|
||||
show_reverse($hostname);
|
||||
show_ipinfo($ip);
|
||||
show_whois($ip);
|
||||
} elseif($method === "dns" ) { // detailed info a host name
|
||||
$hostname = $t;
|
||||
print_header();
|
||||
show_reverse($hostname);
|
||||
show_dnsrecords($hostname);
|
||||
show_whois($hostname);
|
||||
@@ -45,7 +48,7 @@ if($method === "simple") { // simple
|
||||
header("Location:/".$config->detailed_uri."");
|
||||
exit;
|
||||
}
|
||||
footer();
|
||||
print_footer();
|
||||
|
||||
// HTTP HEADERS
|
||||
function show_http_headers() {
|
||||
@@ -151,13 +154,26 @@ function show_dnsrecords($hostname) {
|
||||
echo "<br />\n";
|
||||
}
|
||||
}
|
||||
// PRINT HEADER
|
||||
function print_header() {
|
||||
print '<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>IP and DNS information</title>
|
||||
<link rel="icon" type="image/png" href="/favicon.png">
|
||||
</head>
|
||||
<body>
|
||||
';
|
||||
}
|
||||
// PRINT FOOTER
|
||||
function footer() {
|
||||
function print_footer() {
|
||||
global $config;
|
||||
echo "<br /><hr /><br />\n";
|
||||
echo 'Your plain IP address: <a href="//'.$config->ip4domain.'">IPv4</a> | <a href="//'.$config->ip6domain.'">IPv6</a>';
|
||||
echo "<br />\n";
|
||||
echo 'Your detailed IP info: <a href="//'.$config->ip4domain.'/'.$config->detailed_uri.'">IPv4</a> | <a href="//'.$config->ip6domain.'/'.$config->detailed_uri.'">IPv6</a>';
|
||||
echo '</body></html>';
|
||||
}
|
||||
|
||||
// HELPER FUNCTIONS
|
||||
|
||||
Reference in New Issue
Block a user