Click to See Complete Forum and Search --> : DETECTS IP OF VISITOR in Javascript
kamio
01-02-2003, 07:42 AM
HI THR.
I am finding out how to detect the IP address of a visitor who
visits a web-site? Please how to write the codes in Javascript. Thank You.
Yours sincere,
Mr Jul
khalidali63
01-02-2003, 07:48 AM
Sorry,
you can not do that using JavaScript( as yet).
For this purpose you have to use some server side programming language such as
VB,Java and so on
Khalid
For this you probably should use an server side language like PHP, ASP, Perl etc.
But most of those IP adresses are dynamically, so ...
kamio
01-03-2003, 07:06 AM
Hi there. In my response to my question above, i dont know how to detect IP addresses of visitors of a web-site ie for the purpose of recording their information. I hope my question is clear. How this is done in Java Script? I know there are an example of java-script which identify the IP address of your computer but i missed the file. Thank you for your help.
yours sincere,
ju
khalidali63
01-03-2003, 07:25 AM
No Kamio,
You can not detect a users IP address using JavaScript.
The example you are refereing to must be using some kind of server side scripting.
Khalid
Actually, in NN4 with java enabled it is possible to get user IP address, it doesn't work in IE or the later version of NN, but that might be what you remember seeing. If you don't mind renaming your pages to .php or using an iFrame, here's how to get it in PHP
<? echo $REMOTE_ADDR ?>
Just include that line where you want to show the IP.