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 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2003
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    restricting access (kind of)

    hey. just found the site. love it anyways my question is how do i make a page only accessable if the user if coming from another page? like i set the page that they have to come from to be able to get into the page. you know what i mean? please help me out. thanks

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    it is possible with javascript but if the user disabled it, they can pass through it.

    <head>
    <script>
    if (document.referrer!="http://mydomain/somepage.htm") location.href="somepage.htm";
    </script>
    </head>

    to be more strict, you should use server-side language to check the referrer.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

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