I'm trying to do something that is (probably) VERY easy, but I sure can't figure it out! I want to create a user link on an aspx webpage for a user to click, and when they click it, depending on what their local address is, I want to open either of two webpages.
I believe I probably need to use a <%=Request.ServerVariables("LOCAL_ADDR")%> call, but I have tried 100 different ways of doing this, without any success. In fact, I can't get the Request.ServerVariables() call to return ANYTHING (no errors, but no data either).
In my (simple!) mind, I would like to do something from javascript like so:
<script language="javascript" type="text/javascript">
function AorB(urlA, urlB) {
var myip = <%=Request.ServerVariables("LOCAL_ADDR")%>;
if (myip == "192.10.4.7")
MyOpenWindow = window.open(urlA, '_blank');
else
MyOpenWindow = window.open(urlB, '_blank');
history.go(0);
}
</script>
Can anyone help with this??
Thanks!
-tom
P.S. if I have posted to the wrong forum I apologize, but I figured since I can't even figure out how to use ASP Server Variables that this was the correct place to start.
I believe I probably need to use a <%=Request.ServerVariables("LOCAL_ADDR")%> call, but I have tried 100 different ways of doing this, without any success. In fact, I can't get the Request.ServerVariables() call to return ANYTHING (no errors, but no data either).
In my (simple!) mind, I would like to do something from javascript like so:
<script language="javascript" type="text/javascript">
function AorB(urlA, urlB) {
var myip = <%=Request.ServerVariables("LOCAL_ADDR")%>;
if (myip == "192.10.4.7")
MyOpenWindow = window.open(urlA, '_blank');
else
MyOpenWindow = window.open(urlB, '_blank');
history.go(0);
}
</script>
Can anyone help with this??
Thanks!
-tom
P.S. if I have posted to the wrong forum I apologize, but I figured since I can't even figure out how to use ASP Server Variables that this was the correct place to start.