By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,543 Members | 2,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,543 IT Pros & Developers. It's quick & easy.

How to authenticate users with htaccess?

P: n/a
Can I use PHP and htaccess to authenticate users?

My service provider lets me password protect directories on my web site -
using htaccess. If a user tries to access a page within a password
protected directory, a dialog is received requesting username and password.
But I want to provide a login page that users go to first, and then are
directed to the page/directory that they are allowed to see based on their
username/password.

Is it possible to use an html form on a login page that posts the username
and password to htaccess and then automatically takes the user the specified
directory/page? I'd like to set this up with a simple file-based systems
for a handful of users and then move to a database authentication system
using MySql when there are more users.

Is this possible? Are there any examples out there?

Thanks in advance.
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Tue, 17 Aug 2004 18:30:00 +0000, deko wrote:
Can I use PHP and htaccess to authenticate users?

My service provider lets me password protect directories on my web site -
using htaccess. If a user tries to access a page within a password
protected directory, a dialog is received requesting username and password.
But I want to provide a login page that users go to first, and then are
directed to the page/directory that they are allowed to see based on their
username/password.

Is it possible to use an html form on a login page that posts the username
and password to htaccess and then automatically takes the user the specified
directory/page? I'd like to set this up with a simple file-based systems
for a handful of users and then move to a database authentication system
using MySql when there are more users.

Is this possible? Are there any examples out there?

Thanks in advance.

Can't be done. The only method of login for HTTP_AUTH is via the browser's
default popup login box.

There's code available to _process_ these login details (ie: capture
username and redirect to specific location) but that's about as far as it
goes for flexability in that auth mechanism.


Regards,

Ian

--
Ian.H
digiServ Network
London, UK
http://digiserv.net/

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.