Re: Using PHP to do centralized site authentication

From: Date: Sun, 28 Jan 2001 05:42:02 +0000
Subject: Re: Using PHP to do centralized site authentication
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-37098@lists.php.net to get a copy of this message
I'm trying to do something in PHP4.0.4p1 that in the past I've done in mod_perl, but appears to be more difficult. Basically I have some PHP code that does access checks against a DB to see if that user has access to the requested URL. I'm using mod_layout to call the PHP script so I can wrap static html pages, CGI's, and not just PHP pages.
I may be misunderstanding your question, but it seems to me if you use the HTTP_AUTH mechanism built into PHP you can authenticate against a database or whatever you need in PHP before any page output is generated whatsoever. If the user is not authenticated, PHP just generates a standard 302, just as if you were using basic auth under Apache. If you structure your script logic correctly, there should be no output being processed until authentication has been made. My apologies if I've totally misunderstood your situation. Kristofer -- ______________________________________ Kristofer Widholm Web Pharmacy webpharmacy@brokenhill.net 191 Grand Street, Brooklyn NY 11211 718.599.4893 ______________________________________

« previous php.general (#37098) next »