This commit is contained in:
Kar l5
2024-05-28 17:52:13 +05:30
commit b9e2e40f11
36 changed files with 2828 additions and 0 deletions

19
what-is-my-ip.php Normal file
View File

@@ -0,0 +1,19 @@
<?php
// Get the IPv4 address of the client
// echo $_SERVER['REMOTE_ADDR'];
$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>";
?>