not that this has anything to do with databases... ([php-db])

assuming;
1. you are using apache
2. you have command-line access to your server
3. your webhost has htaccess enabled and configured to use ".htaccess" as
the security file

you should be able to drop a file called (usally) ".htaccess" into the
directory you want to secure. you then go to the command line and do
something like

$ htpasswd -c "/home/you/htbin/.htpasswd" username

which creates (-c) the password file (/home/you/htbin/.htpasswd) and adds a
user called "username" to it. when you hit enter it will ask for a password
(twice).

now the .htaccess file which is in your "to-be-secured" directory needs to
look something like this;

==== snip
AuthUserFile /path/to/htpasswd/file
AuthName "Name to Appear in Box"
AuthType Basic

<Limit GET POST>
require valid-user
</Limit>
==== snip

that example looks in "/path/to/htpasswd/file" and confirms that the
user/pass combintation is a "valid-user" (any valid combo from the file) and
if so, allows them access.

you can get more information on all of this in the apache docuemntation at
apache.org, search for "htaccess" and you might also be interested in the
groups ability of the system, so search for "htgroup" (i think)

hth

beau


// -----Original Message-----
// From: news.php.net [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 21 January 2002 3:36 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] HTTP authentication
// 
// 
// Heya,
// 
// I'm trying to find out how http header authentication works. 
// For some reason
// my webserver won't do it on a directory basis. But the 
// problem is that the
// documentation that came along with the PHP package doesn't 
// help me much.
// 
// Can you guys give me a working example on how to use and 
// implement it?
// 
// I would really appreciate it,
// 
// Kevin
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to