Page 1 of 1

Password Protected Area newbie question :)

Posted: Mon Dec 08, 2003 12:39 pm
by lazersam
Hi all

I am new to PHP and learning it slowly. My project at the moment is to create a password protected directory that only members can access.

So far I have a log in page that users input their username and password. That is submitted to an authenticate php script that matches the entries with database entries.

My question is what do I do next? I have a .htaccess file in the directory, how do I tell it to let my user in? Can someone advise?

Regards


Lawrence.

Posted: Mon Dec 08, 2003 12:53 pm
by dyconsulting
If you are using database to authenticate user you might think about not using .htaccess file. I would just see if I have an entry in db (username and password), store that userid on session or in the cookie and redirect to logged in page.

Posted: Mon Dec 08, 2003 3:38 pm
by lazersam
Thanks Dmitry - I have rewritten my script to start a session if the username and password are found in the same row in the database.

The only problem is that my site offers downloads for members only, is there anyway I can protect the download files from unauthorised access?

Thanks for your help

Lawrence