I had this very, very evil idea that for April 1 I would make a tiny change to our Firm home page such that anyone viewing it from inside the firewall would see a big story about how we had been acquired and salaries were being raised, etc.

Consulting various sources, I found a way to do this using JavaScript and an IP address. For example:

<pre><html><head><title>REMOTE_ADDR Detection Test</title></head>
<body><h2>Welcome!</h2>
<script language="JavaScript">
var ip = '< !--#echo var="REMOTE_ADDR"-- >'; //remove spaces in comment tags
if (ip == "192.168.0.199") {
document.write("

You are our big winner, "+ip+"!</p>");
}
else {
document.write("

You are a pathetic loser, "+ip+"!</p>");
}
</script>


Have a nice day!</p></body></html></pre>

However, it appears that IIS 4 does not send the REMOTE_ADDR variable to the browser unless I name the page with an .SHTML extension, which obviously complicates the project.

Casting about for ideas, I thought perhaps I could use ASP "behind the scenes" to pass the variable to an HTML page using a JavaScript source include. It took numerous iterations to get it right, but here it is:

<pre><html><head>
<title>REMOTE_ADDR Detection Test</title>
<script src="myjs.asp">
< !-- var aspip is defined in the included source file -- >
//remove spaces in above comment tags
</script>
</head>
<body><h2>Welcome!</h2>
<script language="JavaScript">
if (aspip == "192.168.0.199") {
document.write("

You are our big winner, "+aspip+"!</p>");
}
else {
document.write("

You are a pathetic loser, "+aspip+"!</p>");
}
</script>


Have a nice day!</p></body></html></pre>

The code of the corresponding myjs.asp page is:
<pre>var aspip = '<%=Request.ServerVariables(&quot;REMOTE_ADDR&quo t%>';</pre>

Naturally, to test this, you must access it from an IIS server; I tested on 4.0.

Heh heh. Off to be very, very bad...