php-general | 2000071
Date: 07/15/00
- Next message: Brett C.: "[PHP] set cookie"
- Previous message: Keith Vance: "Re: [PHP] compiling with oracle"
- In reply to: Ed Warvel: "Re: [PHP] Newbee question?"
- Next in thread: Samuel Beam: "Re: [PHP] Newbee question?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sat, 15 Jul 2000, Ed Warvel wrote:
> I do have htaccess files. Do you mean I can define a function to
> automatically execute using htaccess, or do you mean to just use it to
> password protect the folder. If the later it won't work because I want the
> passwords database driven.
Ed,
I've also used CF and the application.cfm. For what I've done, I've never
needed a similar system for PHP. I usually just include "header.inc" or
something, and put that first on each file. Rasmus was referring, most
likely, that you could put that httpd.conf directive (the prepend one) in
an .htaccess file in that directory, and all pages would be prepended.
So, if you have .htaccess access, you could do that.
Yes, you can use .htaccess along with htpasswd to create password
protected sites, but you are correct, it wouldn't come from a database and
PHP wouldn't have much to do with it.
However, you can easily build your own basic auth system using
AUTH_PHP_USER and AUTH_PHP_PASS (? _PASSWD? I'm too lazy to check). I've
done it several times and I know others have, too.
Using that method, you can check a database for login/passwords easily.
Plus, you can use that to verify, on each page, that someone is logged in,
which saves having to use cookies. The paranoid (like me) don't enable
cookies, or do so selectively.
So, if all you want to do is have a basic auth login prompt, put the
prepend directive in the .htaccess file at the top of the protected area
and in the prepended file, use the above mentions $AUTH_PHP_USER system.
There are many such scripts, too. Check the links area of php.net
Hans Anderson ~ me <email protected>
PO Box 426, Missoula, MT 59806 | PHP, Search Engines, SQL
(800)397-9116 / (406)549-6524 | Databases, Flash Multimedia,
http://www.hansanderson.com | Killer Audio Production,
http://www.goofiness.com | Minty Fresh Breath.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Brett C.: "[PHP] set cookie"
- Previous message: Keith Vance: "Re: [PHP] compiling with oracle"
- In reply to: Ed Warvel: "Re: [PHP] Newbee question?"
- Next in thread: Samuel Beam: "Re: [PHP] Newbee question?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

