Friday 30 November 2012

Specify Referring Page Using Javascript

Specify Referring Page Using Javascript


This script makes sure that your visitor can only reach a given page from the page that you specify. Paste the following before the ending head tag on the page: 


<SCRIPT LANGUAGE="JavaScript">
var allowedreferrer = "http://www.yoursite.com/referringpagename.htm"; 
if (document.referrer.indexOf(allowedreferrer) == -1) {
alert("You can only access this page from " + allowedreferrer);
window.location=allowedreferrer;
}
</script>

1 comment:

Thank You for Your Comments. We will get back to you soon.

back to top