Hi all,
I've searched far and wide for a script that allows users to my site only if they came from a certain page (my login page). Well, I found it. The problem is that for some strange reason it stopped working with IE, but still works with Mozilla Firefox. No matter what I do, I keep getting the flag message in IE (must login first). I'm posting the actual script right from the page, so please if any sees why it is not allowing people with IE browsers, let me know.
I appreciate your time.
Thank You.
Here's the code:
<script>
function IsValidReferral()
{
from=document.referrer
domainname=from.substring(from.indexOf("//")+2,from.length)
domainname=domainname.substring(0,domainname.index Of("/"))
var referal_list=new Array("home.cogeco.ca","xyzabctemp.com","xyzabctem p1.com","xyzabctemp2.com");
flag=false;
for(i=0;i<referal_list.length;i++)
{
if(domainname==referal_list[i])
{flag=true
break;
}
}
if(!flag)
{alert("You Have To Login First To The Members Area "+from)
//It's not a referral site,Move to your login Page
location.href="http://home.cogeco.ca/~grimreaper/"
}
}
IsValidReferral();
</script>
Again, Thank You...