Click to See Complete Forum and Search --> : IP adress


Carloshtm
12-12-2003, 04:28 PM
Hello, I have a question :confused: ,
Do someone know the script to show the users IP on the web page? I mean, like if I go into my site, the start page will show my own IP adress. Can someone help me? Please reply this message if you do. Carlos

idiotsoftcorp
12-12-2003, 05:34 PM
I did not write this script but I think it does what you want.

<!-- 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
var ip = '<!--#echo var="REMOTE_ADDR"-->';
alert("Your IP address is "+ip);
window.defaultStatus = "Your IP address is "+ip;
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>

fredmv
12-12-2003, 07:59 PM
Note that your server will need to support SSI and you will need to have a file extension that is associated with SSI (such as .shtml) for that to work correctly.

pyro
12-12-2003, 08:04 PM
That JavaScript is really rediculous. It use SSI (Server Side Includes) to write the IP address to a variable and then immediatly writes it out with a document.write. Why not just do this??

<title><!--#echo var="REMOTE_ADDR"--></title>