Hello, I am trying to modify this code: <SCRIPT LANGUAGE="JavaScript"> <!-- Begin var requiredfrom = "http://example.com/1.htm"; // if (document.referrer.indexOf(requiredfrom) == -1) { alert("Error: TEXT"); window.location=requiredfrom; } // End --></SCRIPT> Code (markup): The previous code should force any visitor to it's container page to visit "example.com/1.htm" first (visitor can visit the page if example.com/1.htm redirects to it, or contains a link - referrer). I need to add another page like (example.com/1.htm) to the code. I want 2 pages to be able to send traffic to the page, not just 1. Any help? Sorry for my English & thank you.
You can add another condition like this: <SCRIPT LANGUAGE="JavaScript"> <!-- Begin var requiredfrom = "http://example.com/1.htm"; // var requiredfrom2 = "http://example.com/2.htm"; // if ((document.referrer.indexOf(requiredfrom) == -1) && (document.referrer.indexOf(requiredfrom2) == -1) ) { alert("Error: TEXT"); window.location=requiredfrom; } // End --></SCRIPT> Code (markup): But be aware that some browsers or firewalls might have a setting to disable referrers(or javascript) so this might not work for everyone.