[Web4lib] javascript question

Thomas Dowling tdowling at ohiolink.edu
Thu Nov 8 15:35:15 EST 2007


That's a snippet of Javascript that depends on having Server-Side 
Includes (SSI) enabled on the server.  In your case, it has apparently 
been disabled (or you're looking at it on your desktop and not going 
through a web server).

I'd be dumbstruck if there was a server-side scripting language that 
didn't give you a way to determine the user's IP, so the question is, 
what do you have access to on your server?  And why do you want to show 
the user his or her own IP address? (There are reasons, it just isn't 
clear what yours is.)

Thomas Dowling
tdowling at ohiolink.edu


Holley Long wrote:
> Hi,
>
> I found a free javascript that displays the user's IP address in a pop-up box and saved it on a local server. It worked fine two weeks ago. Now, the pop-up box reads:
>
> "Your IP address is <!--#echo var="REMOTE_ADDR"-->"
>
> I haven't made any changes to the script. 
>
> If you know what is going on with this script or can suggest a simple alternative to capture the user's IP in a web page, I'd appreciate your suggestions.
>
> Thanks,
> Holley
>
> Here's the script from JavaScript Source (http://javascript.internet.com/user-details/ip-address.html)
>
>
> <!-- ONE STEP TO INSTALL IP ADDRESS:
>
>   1.  Copy the coding into the HEAD of your HTML document  -->
>
> <!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->
>
> <HEAD>
>
> <SCRIPT LANGUAGE="JavaScript">
>
> <!-- This script and many more are available free online at -->
> <!-- The JavaScript Source!! http://javascript.internet.com -->
>
> <!-- Begin
> // http://www.kdcgrohl.com
>
> // Depending on your server set-up,
> // you may need to use the ".shtml"
> // extension [instead of the "html"
> // or "htm"] as the script uses Server
> // Side Includes. To display in the
> // title bar, exclude the
> //"<title></title>" code from the page.
>
> // This part gets the IP
> var ip = '<!--#echo var="REMOTE_ADDR"-->';
>
> // This part is for an alert box
> alert("Your IP address is "+ip);
>
> // This part is for the status bar
> window.defaultStatus = "Your IP address is "+ip;
>
> // This part is for the title bar
> document.write("<title>Your IP address is "+ip+"</title>");
> //  End -->
> </script>
>
>
> <p><center>
> <font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
> by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
> </center><p>
>
> <!-- Script Size:  1.09 KB -->
> _______________________________________________
> Web4lib mailing list
> Web4lib at webjunction.org
> http://lists.webjunction.org/web4lib/
>
>   




More information about the Web4lib mailing list