Cyprich.com

Occasionally Relevant Insights from a Software Builder

By

Get the IP of Your Web Site

You may need the IP of your web site for various purposes, such as using it to connect to your web site with FTP or SSH. There are a few utilities which can display your IP, such as the ShowIP extension for Firefox. You can also create a very simple web site which will show the IP of your web site.

Copy and paste the code below into a file called ip.php and save it in the root folder of your web site. Change the $site variable to match the domain of your web site, and then open this page in your web browser, i.e. http://www.guardiansoftware.net/ip.php.

The IP of your web site will be revealed.

===[ ip.php ]==========================

<html>
<head>
<title>Display IP</title>
</head>

<body>
<?php

$site = ‘www.guardiansoftware.net‘;
$ip = gethostbyname ($site);

echo “<p>IP: $ip</p>”;

?>
</body>
</html>

One Response to Get the IP of Your Web Site

  1. Mavis says:

    I enjoy, lead to I discovered exactly what I was taking a
    look for. You have eended my four day long hunt! God Bless you man. Have a nice day.
    Bye

Leave a Reply

Your email address will not be published. Required fields are marked *