Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder DR.Wong's Avatar
    Join Date
    Jan 2005
    Posts
    360
    Thanks
    23
    Thanked 1 Time in 1 Post

    Smile Limited page access Security

    Hey guys,

    How do I make a page check the browser's history and only if it comes from a certain page, will the page in question be displayed. If the page detects that the user has navigated from 'a.htm' instead of 'b.htm' the javascript redirects the user to 'security.htm'

    Do you get it?

    It does not have to use history, just thats the only way I can see the js working.
    This only has to work with IE 5+

    Thanks!
    -DR.Wong

    Wheres the food at?

  • #2
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    document.referrer gets the last page the user visited, so you could write a script to check what the page was and if it wasn't b.htm then it redirects them to the security.htm page.

    EDIT - ... thought I may as well post the script as well!

    Code:
    if (document.referrer = "a.htm")
    location.href = "security.htm"
    Last edited by mark87; 03-19-2005 at 05:05 PM. Reason: To Add In The Script

  • #3
    Regular Coder DR.Wong's Avatar
    Join Date
    Jan 2005
    Posts
    360
    Thanks
    23
    Thanked 1 Time in 1 Post

    Smile

    If you would be so kind...

    It would be a great help!

    I am not so familiar with this kind of stuff.

    Thanks!
    -DR.Wong

    Wheres the food at?

  • #4
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts


  •  

    Posting Permissions

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