That doesn't need the Javascript portion to work but it does need Server Side Includes (SSI) to be turned on in order to work in which case <!--#echo var="REMOTE_ADDR"--> will display the IP address at whatever point you include it in the HTML (provided your filename ends in .shtml).
There is no way to get your visitor's IP address without server side processing because HTML, CSS, Javascript etc that run in the client have no access to anything outside the page and can't see the IP address unless a server side process gives it to them.
To get the IP address you need SSI, PHP, ASP, or some other server side language to extract it for you and then give your page the appropriate extension so that the server side language will be run on the page before it is delivered to the browser.
The script at: http://javascript.internet.com/user-...p-address.html works THERE,
but the script offered doesn't work when copied.
The pop-up displays: /!\ Your IP address is <!--#echo var="REMOTE_ADDR"-->
The source code has my IP address INSTEAD of the generating echo code!
not HOW it was fetched.
var ipAddress = <!--#echo var="REMOTE_ADDR" -->;
returns: /!\ Your IP address is undefined Getting closer...
I have tried this script mounted on a web page, not just on my computer.
How do I 'define' the the IP address or "REMOTE_ADDR" ?
Can someone correct this? what is the complete correct code?
using Firefox 2.0 or Seamonkey1.1, SUSE Linux.
Bookmarks