<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Display Static IP</title>
</head>
<body>
<h1>Your Static IP Address</h1>
<?php
// Get the client's IP address
/*if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
// Check if the IP is coming from a shared internet connection
$ip = $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
// Check if the IP is coming from a proxy
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
// The IP is coming directly from the client
$ip = $_SERVER['REMOTE_ADDR'];
}
// Display the client's IP address
echo "Your IP Machin IP address is: " . $ip;
echo "<br>";
*/?>
<?php $ip = $_SERVER['REMOTE_ADDR'];
echo "Your server's static IP address is: " . $ip;
?>
<?php
// Fetch the public IP of the server from an external service
/*$serverIP = file_get_contents('https://api.ipify.org'); // Use ipify API to fetch the public IP
// Alternatively, you can use ipinfo.io
// $serverIP = file_get_contents('https://ipinfo.io/ip');
// Display the server's static IP address
echo "Your server's static IP address is: " . $serverIP;
*/?>
</body>
</html>