Web Design
Displaying a Visitor's IP Number
If you find a need to display your visitor's IP number on a web page, you will find it a snap to do. It can be done using SSI (server side includes) or PHP. You will need to be sure that your hosting service can support either language. During these days of modern techology most good hosting services can support both programming languages.
SSI
Place the following code in the location of your web page where you want the IP number to appear. Name your page with a .shtml extension.
<!--#echo var="REMOTE_ADDR"-->
PHP
Place the following code in the location of your web page where you want the IP number to appear. Name your page with a .php extension. (Some hosting companies may have a different extension requirement such as a .php3 extension. If it does not work, contact them to find out what extension to use.)
php echo $REMOTE_ADDR;
|