|
-
June 12th, 2003, 02:46 AM
#5
You dont nessisarly have to use .htaccess and .htpasswd to password protect areas of your site.
Here is an example:
Simple Login, Logout, and Session Handling http://www.etronicscomputers.com/doc...rbeginners.htm
In my case, I used php. First I created a simple form, with two fields, username and password, then when it is submited, it gets sent to the same page. On that page, I wrote a php script that opens a file pwds.dat which contains usernames and passwords in this format
user1:encriptedpasswd\nuser2:encriptedpasswd
The username is first searched for, if the username is found inside pwds.dat then the user is valid, then I take the password, and i crypt it useing DES, and compare it to the password in pwds.dat, if they match then the password is corect, I start a session, and register username and password to a session. Then redirect to the page. Else I just display an error like, your password did not match, or you are not a valid user.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|