Results 1 to 2 of 2

Thread: Restricted access
      
   

  1. #1
    ModelT is offline Sergeant
    Join Date
    May 2007
    Posts
    25

    Default 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?

  2. #2
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default 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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49