snowcake-website/ip-info/index.php

32 lines
859 B
PHP
Raw Normal View History

2022-11-20 02:02:26 +00:00
<!--Page design by Lilium_Snow (Primrose) (2022)-->
<!--This HTML document is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. Get a copy of the license at https://creativecommons.org/licenses/by-sa/4.0/legalcode-->
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>IP Info - Snowcake</title>
<link rel="icon" type="image/x-icon" href="/assets/images/favicon.png">
<link rel="stylesheet" href="/main_theme.css">
<meta charset="UTF-8">
</head>
<body>
<h1>IP Info</h1>
<div>
<a href="/" class="button">🏠 Back to Home</a>
</div>
<br>
<br>
<div class="content">
<?php
$client_ip = $_SERVER['REMOTE_ADDR'];
$client_hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
echo "<p>IP: $client_ip</p>";
echo "<p>Hostname: $client_hostname</p>";
?>
</div>
</body>
</html>