does PEAR auth expects the username & password encrypted in the database?
- From: odaldecoa@xxxxxxxxx
- Date: 18 Aug 2006 03:13:25 -0700
Hi all in php.general,
I would appreciate very much if any of you could help me to get this
simple auth example to work.
When running a pear auth example (below), Auth connects correctly to
the database, but the username and password I type in the login-form
are never recognized, so I cannot login.
I think it's a problem with the way I've stored my username and
password in the database.
I've tried plain text, MD5 encryption for the password, MD5 for both
user name and password (using phpmyadmin), but yet I cannot login.
Do the username & password in the database need to be encrypted?
Would you have any hints of what I am doing wrong?
Many thanks in advance for any help you can provide.
Best wishes,
Oscar
: )
This is the example script from
http://pear.php.net/manual/en/package.authentication.auth.intro.php:
<?php
require_once "Auth.php";
function loginFunction()
{
echo "<form method=\"post\" action=\"testauth.php\">";
echo "<input type=\"text\" name=\"username\">";
echo "<input type=\"password\" name=\"password\">";
echo "<input type=\"submit\">";
echo "</form>";
}
$dsn = "mysql://admin:xxxxxx@localhost/testoscar";
$a = new Auth("DB", $dsn, "loginFunction");
$a->start();
if ($a->checkAuth()) {
echo "welcome";
}
else {
echo "login error";
}
?>
.
- Follow-Ups:
- Prev by Date: Re: memory usage
- Next by Date: PHP and VMware: SLOW
- Previous by thread: memory usage
- Next by thread: Re: does PEAR auth expects the username & password encrypted in the database?
- Index(es):
Relevant Pages
|