H
Hugo Sousa
Hello,
I have a page that cannot be accessed by typing is url. It should only be
accessed by a link in another web page. The following scrip works fine:
<script>
<!--
var validreferrals=new Array()
validreferrals[0]="http://pdc/test/index.htm"
validreferrals[1]="http://pdc/test/index2.htm"
var passed=0
for (r=0;r<validreferrals.length;r++){
if (document.referrer.indexOf(validreferrals[r])!=-1){
passed=1
break
}
}
if (passed==0) {
alert("Access denied!")
history.go(-1)
}
//-->
</script>
My problem is that on one of the pages, (index2.htm) i use
window.location="http://pdc/test/index3.htm" (this is the protected page) to
access it, and it looks like the referrer is empty in this way. Is that any
any to solve my problem?
Best regards
Hugo Sousa
PS: Hope this is clear. If someone need more explanation, don't exitate to
post here asking for a more clear description
I have a page that cannot be accessed by typing is url. It should only be
accessed by a link in another web page. The following scrip works fine:
<script>
<!--
var validreferrals=new Array()
validreferrals[0]="http://pdc/test/index.htm"
validreferrals[1]="http://pdc/test/index2.htm"
var passed=0
for (r=0;r<validreferrals.length;r++){
if (document.referrer.indexOf(validreferrals[r])!=-1){
passed=1
break
}
}
if (passed==0) {
alert("Access denied!")
history.go(-1)
}
//-->
</script>
My problem is that on one of the pages, (index2.htm) i use
window.location="http://pdc/test/index3.htm" (this is the protected page) to
access it, and it looks like the referrer is empty in this way. Is that any
any to solve my problem?
Best regards
Hugo Sousa
PS: Hope this is clear. If someone need more explanation, don't exitate to
post here asking for a more clear description