snowcake-website/ip-info/index.php

8 lines
206 B
PHP
Raw Normal View History

<?php
2022-11-07 03:25:10 +00:00
$client_ip = $_SERVER['REMOTE_ADDR'];
$client_hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
echo "<p>IP address: <b>$client_ip</b></p>";
echo "<p>Hostname: <b>$client_hostname</b></p>";
?>