...

View Full Version : Password Protected page



holty
10-27-2003, 03:15 PM
I want to have one php page password protected. I know the login script could check values in a database but i don't really want to use a database as there will only be one username and one password.

Can this be done using a text file? how about the security?

All i really want is for someone to login and view this page that has a list of confidental links to documents on an intranet.

Thanks

Acecool
10-27-2003, 04:58 PM
If you only need 1 user and 1 pass, then do this

name="password" in the form

$hashedpass = md5($password);
if ($username == "blah" && $hashedpass == "md5 value")

Spookster
10-27-2003, 06:13 PM
Or you can simply use a .htaccess file with a corresponding .htpasswd file.

holty
10-28-2003, 12:00 PM
cheers

spookser - how would i use the .htaccess file? have u any decent links on the subject?

SDP2006
10-28-2003, 01:29 PM
http://www.spoono.com/php/tutorials/tutorial.php?id=30

That is a good one --

Spookster
10-28-2003, 01:29 PM
http://www.javascriptkit.com/howto/htaccess3.shtml

Caffeine
10-28-2003, 01:31 PM
If you had tried the search-link at the top of the forums, maybe you would have found this excellent tutorial:
Comprehensive guide to .htaccess (http://www.javascriptkit.com/howto/htaccess.shtml)

My search for "htaccess" resulted in 3 pages !!

Acknowledge the searchengine and you'll save yourself and others some valuable time!;)

Hey, i'm thinking of putting that into my signature :p


I mean no harm, i'm in a weird mood today... but still, you could probably have used the searchengine :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum