Restricted access

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • ModelT
    Sergeant

    • May 2007
    • 25

    Restricted access

    Is there a way to restrict access to an entire website. I need people to enter their email address before viewing the website. Can this be done?
  • Watdaflip
    Major General

    • Sep 2005
    • 2116

    #2
    Re: Restricted access

    A simple way no, not really. The only way I can think of doing that would be to set a cookie or session once they have entered their email address, and then adding some code to every page on that website to check if that cookie or session exists, otherwise redirect them to a form to enter their email address.

    But when they leave for an extended period of time the session expires, and if they delete their cookie they will have to enter it again. You could probably track their IP as well, and if either a cookie or session isn't found, you can have it double check if the IP they are using has entered an email address, if so give access, otherwise redirect.

    Thats about the only way I can think of handling it. A .htaccess script could handle blocking access for the whole site, but there isn't a way I know of to conditionally check if they entered an email and then block it

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

    Comment

    Working...
    X