PrintLogo

Using SSI and Javascript to Report Client IP Address




To set a variable to the remote IP address of the client, use this:

var ip = '<!--#echo var="REMOTE_ADDR"-->';

Apache needs the include module either loaded or compiled in. Also, these options need to be specified in httpd.conf:

AddHandler    server-parsed .shtml
AddOutputFilter INCLUDES .shtml
Options Includes

Check out this page for more information about SSI.



This article comes from NetAdminTools:
http://www.netadmintools.com/

The URL for this story is:
http://www.netadmintools.com/art421.html

Copyright 1997-2008 NetAdminTools.com. Read our Terms of Use.