clean
This commit is contained in:
17
.hta_slug/what-is-my-ip.php
Normal file
17
.hta_slug/what-is-my-ip.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
$ipv4 = $_SERVER['REMOTE_ADDR'];
|
||||
|
||||
// Get the IPv6 address of the client if available
|
||||
$ipv6 = $_SERVER['REMOTE_ADDR'];
|
||||
if (strpos($ipv6, ":") !== false) {
|
||||
// IPv6 address detected
|
||||
$ipv6 = explode("%", $ipv6)[0]; // Remove interface suffix, if any
|
||||
} else {
|
||||
// No IPv6 address detected
|
||||
$ipv6 = "IPv6 not available";
|
||||
}
|
||||
|
||||
// Display IPv4 and IPv6 addresses
|
||||
echo "IPv4 Address: " . $ipv4 . "<br>";
|
||||
echo "IPv6 Address: " . $ipv6 . "<br>";
|
||||
?>
|
||||
Reference in New Issue
Block a user