HTML script for IP Lookup

Created on 3 July, 2024 • 92 views

HTML script for IP Lookup

<!DOCTYPE html>

<html>

<head>

 <title>Your IP Address</title>

</head>

<body>

 <h1>Your IP Address:</h1>

 <p id="ip-display">Finding your IP...</p>


 <script>

  fetch('/iplookup.php') // Replace '/iplookup.php' with your script path

   .then(response => response.text())

   .then(data => {

    document.getElementById('ip-display').textContent = data;

   })

   .catch(error => {

    console.error('Error fetching IP:', error);

    document.getElementById('ip-display').textContent = 'Error: Could not retrieve IP.';

   });

 </script>

</body>

</html>