LadyYepperz
Programmer
Please help me with this script. I've tried repeatedly to get this script to work. If a subpage (page2) on my site is linked directly, this script is suppose to redirect the browser to the home page (page1). But when page2 IS opened from page1, instead of showing page2, it directs the browser back to page1.
Still with me?
page2 opens up in a new window.
it opens as its suppose to, but it shows page1 with
the address bar showing the address for page2
so im REALLY confused!
here is an example of whats going on...
************************************
Script Name: Must Visit From...
Description: If other sites links directly the sub-pages of your site or if previous required pages are being skipped, you can now require your visitors to come from a certain page! Those that did not come from the required page are alerted then sent back to the required previous page. Clever!
<!-- ONE STEP TO INSTALL MUST VISIT FROM....:
1. Copy the coding into the HEAD of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var requiredfrom = "index.html"; // required prev. page
if (document.referrer.indexOf(requiredfrom) == -1) {
alert("You must come to this page from " + requiredfrom);
window.location=requiredfrom;
}
// End -->
</script>
************************************
Thanks in advance for your help.
Still with me?
page2 opens up in a new window.
it opens as its suppose to, but it shows page1 with
the address bar showing the address for page2
so im REALLY confused!
here is an example of whats going on...
************************************
Script Name: Must Visit From...
Description: If other sites links directly the sub-pages of your site or if previous required pages are being skipped, you can now require your visitors to come from a certain page! Those that did not come from the required page are alerted then sent back to the required previous page. Clever!
<!-- ONE STEP TO INSTALL MUST VISIT FROM....:
1. Copy the coding into the HEAD of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var requiredfrom = "index.html"; // required prev. page
if (document.referrer.indexOf(requiredfrom) == -1) {
alert("You must come to this page from " + requiredfrom);
window.location=requiredfrom;
}
// End -->
</script>
************************************
Thanks in advance for your help.