Results 1 to 2 of 2

Thread: "Must Vist From..." JavaScript

  1. #1
    Join Date
    Oct 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy "Must Vist From..." JavaScript

    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...

    http://www.geocities.com/cocobuttacurves/rettasrepublic/pageone.html"

    http://www.geocities.com/cocobuttacurves/rettasrepublic/pagetwo.html"

    ************************************

    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 -->

    PHP Code:
    <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>

    </head> 
    ************************************


    Thanks in advance for your help.

  2. #2
    Join Date
    Oct 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy

    I know there is someone on this forum with the brain power to help me.
    !! Please, Please, Please Help !! With suger on top!!

    Someone told me today my problem could be that im working in frames...
    Could this be my the reason this script isnt working for me?

    If you cant help me out with this script... Maybe, YOU...
    (Yeah you! The person reading this post.)
    Maybe you can point me in the direction of a WORKING redirect script.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •