Javascript help

Discussion in 'All other topics' started by j_holmes, Dec 3, 2004.

  1. j_holmes

    j_holmes Regular member

    Joined:
    Jun 30, 2004
    Messages:
    203
    Likes Received:
    0
    Trophy Points:
    26
    Hi all,

    I know i've asked about this in the past, but i have to add something.

    I am trying to make my website accessible through my login page only.

    I know there is a way to do it with javascript.
    The only thing I found was this:

    <script language="javascript">
    <!--
    var which_page = "mypage.html";
    var redirect = "http://mypage.html";

    if(document.referrer.indexOf(which_page) == -1)
    {
    document.write("You came from the wrong page!");
    }

    else
    {
    window.location = redirect;
    }
    -->
    </script>


    But, where do I add it?
    In a new page?
    My home page?
    Login page?

    If anyone has any advice,
    please forward it.

    I'm going out of my head trying to do this.


    Thanks again...
     
  2. j_holmes

    j_holmes Regular member

    Joined:
    Jun 30, 2004
    Messages:
    203
    Likes Received:
    0
    Trophy Points:
    26

     
    Last edited: Dec 5, 2004
  3. CJC

    CJC Regular member

    Joined:
    Aug 23, 2004
    Messages:
    585
    Likes Received:
    1
    Trophy Points:
    26
    It would be the Login page you need to add it to, as you saying, If you didnt come from Page xxx, Get Lost basically...

    I think.... Trial and Error :D

    Add into Login page, then upload, try accessing from ur page and see if logins, then try accessing from other page and see if it shows.

    CJC
     

Share This Page