On 3 Oct 2002 at 12:27, Stephen wrote:

> I've been reading tutorials lately on user authentication in PHP and
> they all are for the HTTP way of authentication. How can I use the same
> system but with forms instead of that ugly pop-up box?

Of course the best solution for this is mod_perl (for those who know 
some Perl) but you can cheat in PHP. The problem in PHP is that you 
cannot intercept the Apache request phases as you can with mod_perl. 
I've mentioned this in other posts and even have an example up on my 


I tell apache to use my handler for access/authentication. 

One way to do this in PHP is to have ONE index.php or whatever you set 
the index file to in a folder. It determines who is requesting what and 
then determines if this person is is authorized to access what they 
wanted. You'd have to put the actual *data* outside the document root 
otherwise they might just find it. Your index.php could grab the files 
(if html) and just print them back. I used the same system in Perl 
before learning of mod_perl. So far this is the only case where I can 
do something in mod_perl that I cannot do as eloquently in PHP but 
since I don't mind the pop up box that's not a big deal and since most 
of my apps go through just a few php handlers I do my own auth/access 
for every request and return my custom login page when needed.


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to