Re: PHP auth... a little help :)
| From: | Chris Lee | Date: | Thu, 08 Feb 2001 21:04:02 +0000 |
| Subject: | Re: PHP auth... a little help :) | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-38812@lists.php.net to get a copy of this message | ||
This is the file I include, works for me. cookie.egn just sets the session
variable 'SessionID' and database.egn just has my fetch_db_value functions.
Email me if you have any more questions.
http://www.php.net/manual/en/features.http-auth.php
<?
include_once('cookie.egn');
include_once('database.egn');
function bad_passwd()
{
echo "You have entered an invalid password.<br>\n";
exit();
}
if ( isset($PHP_AUTH_USER) AND isset($PHP_AUTH_PW) AND $peop_r =
fetch_db_value('people_manager', "WHERE username = '$PHP_AUTH_USER' AND
password = '$PHP_AUTH_PW' ") )
$SessionID = $peop_r['peopleID'];
else
{
Header("WWW-Authenticate: Basic realm='$SERVER_NAME' ");
Header("HTTP/1.0 401 Unauthorized");
bad_passwd();
}
?>
--
Chris Lee
Mediawaveonline.com
lee@mediawaveonline.com
""Brandon Orther"" <brandon@webintellects.com> wrote in message
news:CKEMJEADMOCEHPHJKLPAMEEJCGAA.brandon@webintellects.com...
> Hello,
>
> Does anyone have a tutorial on using encrypted passwords for user AUTH?
Flat
> file or Database
>
> Thank you,
>
> --------------------------------------------
> Brandon Orther
> WebIntellects Design/Development Manager
> brandon@webintellects.com
> 800-994-6364
> www.webintellects.com
> --------------------------------------------
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>