techexpressinc
Programmer
:chomp: I want to capture the user's ip address and do a different web page based on the ip address.
The code below gets the ip address but i am having difficultly in using it an "if else " statement later.
I am not sure how to proceed??
<script language="JavaScript">
VIH_BackColor = "palegreen";
VIH_ForeColor = "navy";
VIH_FontPix = "16";
VIH_DisplayFormat = "You are visiting from:<br>IP Address: %%IP%%<br>Host: %%HOST%%";
VIH_DisplayOnPage = "yes";
var ipaddr = %%IP%%;
document.write('You are at '+ipaddr+' .');
</script>
<script language="JavaScript" src="
</script>
This is "like" the if statement I want to use, but i want to use the capture var ipaddr. Which I cannot catch. Can someone help??
<script type="text/javascript">
//If the time is less than 10,
//you will get a "Good morning" greeting.
//Otherwise you will get a "Good day" greeting.var d = new Date();
var d = new Date();
var time = d.getHours();
if (time < 12)
{
window.location="http:://;
}
else
{
window.location=";
}
</script>
Thank you for any help.
Russ @ scaninc.org
The code below gets the ip address but i am having difficultly in using it an "if else " statement later.
I am not sure how to proceed??
<script language="JavaScript">
VIH_BackColor = "palegreen";
VIH_ForeColor = "navy";
VIH_FontPix = "16";
VIH_DisplayFormat = "You are visiting from:<br>IP Address: %%IP%%<br>Host: %%HOST%%";
VIH_DisplayOnPage = "yes";
var ipaddr = %%IP%%;
document.write('You are at '+ipaddr+' .');
</script>
<script language="JavaScript" src="
</script>
This is "like" the if statement I want to use, but i want to use the capture var ipaddr. Which I cannot catch. Can someone help??
<script type="text/javascript">
//If the time is less than 10,
//you will get a "Good morning" greeting.
//Otherwise you will get a "Good day" greeting.var d = new Date();
var d = new Date();
var time = d.getHours();
if (time < 12)
{
window.location="http:://;
}
else
{
window.location=";
}
</script>
Thank you for any help.
Russ @ scaninc.org