PDA

View Full Version : REQ: View IP Address.



pcew
12-01-2005, 01:33 AM
I need javascript that shows IP address of person viewing my site or a webpage.

pcew
12-02-2005, 11:14 PM
I got one script which displays Ip address on a popup window. Can anyone try to make this thing display within a page. :)

<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 -->

Twey
12-03-2005, 07:07 AM
Can't be done. The script above uses SSI, which is server-side. The only way to get an IP address is to use some form of server-side scripting.

pcew
12-05-2005, 06:18 PM
so how do we do that?

Well I wanna upload it to geocities, and I use .html web pages.. So even if I get script for server side...will I be able to use it? Reply is appreciated.

Twey
12-05-2005, 07:38 PM
No, you won't. If you want to do this, get a decent host that supports server-side scripts.

WideNationFA
12-07-2005, 03:01 PM
If you have a geocities account, you may access the viewers IP simply by going to your site statistics or your geocities account. You can view IPs only if you are recognized as an admin or some mod. Perhaps you should add the guestbook, and you can view IP's through there. Why is it important to view IPs?

pcew
12-08-2005, 05:37 AM
Well just kinda fun, I like putting javascript[s] on my site.
Thank's for your kind info..
cheers