...

View Full Version : getting client's IP address



bruno
09-23-2004, 06:58 PM
Hi!
how can i get the IP adress of a visiting user to my website?

'til now i've got this lines of code, but it doesn't work :[

-------------------------------------------

var ip ='<!--#echo var="REMOTE_ADDR"-->';
alert("Hello "+ip);

-------------------------------------------
the output is: Hello <!--#echo var="REMOTE_ADDR"--> . Can anyone speak up for me what's happening since i'm a newbbie in this javascipting thing?
thanks in advance.
Bruno. :thumbsup:

Roy Sinclair
09-23-2004, 07:57 PM
That is a Server Side Include (SSI) which gives the IP address, you've got to have a web host that supports SSIs and name your web page with the appropriate extension to make your web server check for SSI code in your page.

There is no way to get the IP address directly using javascript unless your target audience is running the Netscape 4.x series of browser (unlikely).

jbot
09-24-2004, 01:17 AM
There is no way to get the IP address directly using javascript unless your target audience is running the Netscape 4.x series of browser (unlikely).

outta interest, what was the method for that. believe it or not, i'm kinda feeling nostalgic for that old heap of @#*$& LOL - it did have some interesting features!

Roy Sinclair
09-24-2004, 07:52 PM
http://javascript.internet.com/user-details/ip-filter.html -- Even NS 4 had to use a Java applet.

jbot
09-28-2004, 11:50 AM
Even NS 4 had to use a Java applet.

that's not bad. presumably that can still be used in any modern browser though, providing Java is installed and enabled, of course. :cool:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum