Obtaining Your Visitor's IP Address
Join the Discussion
ip = ''+java.net.InetAddress.getLocalHost().getHostAddress();
else ip = 'unknown';
You just need to make sure that the file that contains that code gets parsed for server side includes either by using a .shtml file suffix or by configuring the file suffix you do use appropriately.
The code using PHP is even simpler provided that the file either has a .php suffix or is parsed for PHP.
The ASP version is somewhat longer:
This has been somewhat simplified for those who have upgraded to .NET
The final option I am going to illustrate is how to do it using ColdFusion.