Forum Moderators: mack

Message Too Old, No Replies

How to password protect a page

And record access

         

uscblue

11:07 pm on Nov 26, 2006 (gmt 0)

10+ Year Member



I'd like to create a page on my site for customers to log on w/a password only to view thier page AND know if they have actually loged onto the page. This is a real estate related site that a client could go to to see specific info on thier home. They would need to sign on to thier page to see content I placed there. I would assign the password. I would also like to be able to know IF and WHEN they logged on . . . Is this possible and if so how can I do this.

Thanks

eelixduppy

11:31 pm on Nov 26, 2006 (gmt 0)



Welcome to webmasterworld, uscblue!

This can be accomplished with some server-side scripting. What kind of hosting do you have? What kind of programming languages are installed on that server?

Getting these specifics will help help us point you in the correct direction. :)

MichaelBluejay

4:32 am on Nov 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



eelixduppy is right, server-side scripting is typically the way to go. As an alternative, there's a poor-man's solution that doesn't require you to learn any server-side scripting languages, but the tradeoff is that you have to set up each user manually. You create a folder for each user and put an .htaccess and .htpasswd file in it. That restricts the access. To see whether and when they logged in, you check your server stats (like Analog), or look at your raw log files.

Sample .htaccess file:

AuthType Basic
AuthUserFile /home/user/domain.com/admin/.htpasswd
AuthName "Secret customer area."
require valid-user

Sample .htpasswd file:

username:password

If you need this to be more secure you can encrypt the password. To get an encrypted password type this in the Unix command line:

htpasswd -nb username password

lucianp

8:25 pm on Nov 27, 2006 (gmt 0)

10+ Year Member



his can be solved with JavaScript?