RE: [PHP] Good Login Sample
| From: | Emile Axelrad | Date: | Fri, 30 Jun 2000 21:36:08 +0000 |
| Subject: | RE: [PHP] Good Login Sample | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-4171@lists.php.net to get a copy of this message | ||
> I don't need the full thing done for me, Id just like to have something to
> start with. The existing login scripts I have found have been insufficient
> for what I want to do. They are either just a regular login that checks a
> database and doesn't check every page to make sure the user is
> logged in and
> is a correct user or they don't allow for saving the information to access
> the site.
I think you'll find that if you are using scripts which issue the 403
Unauthorized header
[which will prompt the user for a regular user/pw input automatically by the
browser] then
on most modern browsers you are able to save the login information. It is
the most secure
way of doing things [comparing ease-of-implementation against security] if
you check for
$PHP_AUTH_USER - and you can have it on every page. What you need is this:
login.php and authorize.inc.php - reference authroize.inc.php in every page
you want protected
and authorize.inc.php will then send people back to login.php if they don't
have proper
$PHP_AUTH_USER set. If they do, then it's fine and the page then loads as
normal.
- Emile