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

Thread: Locking Pages?

  1. #1
    New Coder
    Join Date
    Jun 2004
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Locking Pages?

    Hi.

    I wanted to ask if there is a way i guess to perhaps "lock" pages with some sort of javascript? I want to make my website so that if a user wanted to view other pages besides the homepage, the login page would be generated and they would have to log in first, then they would be allowed to be view the other pages.

    Also, after the user has logged in, they will see the URLs of the pages besides the homepage. The next time the user returns to my website, if the user decides to just type in the URLs of the other pages besides the homepage, I want the login page to be prompted, thus preventing users from just viewing my website without logging in.

    Lastly, I wanted to also ask if the "lock" javascript would be the same to prevent the user from clicking the "BACK" button and returning to the website pages AFTER they have logged out?? If the script is not the same, what would it be?


    Can anyone help me with a script to prevent this??


    Thanks in advance. Your help is greatly appreciated.


    -j3nnif3r.

  • #2
    New to the CF scene
    Join Date
    May 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can use document.cookie to set a cookie when logging in and then check on each page whether the cookie exists or redirect to the loggin page otherwise, but that is no safe protection, so you can't have certain users be disallowed on the pages.

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Server side scripting is a tool to be used for this task.
    Javascript can not provide you a reliable solution.
    Find out which language is supported by your host and post this question in appropriate server side sub-forum.
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #4
    New Coder
    Join Date
    Jun 2004
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sorry.

    Hi. I think i posted this question in the wrong forum. PLEASE disregard this post. I have reposted my question in the ASP forum. If you would like to help me, please respond to my post in the ASP FORUM. THanks. Sorry about this inconvenience.


    -j3nnif3r.


  •  

    Posting Permissions

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