having trouble getting AUTH to work
| From: | Stowe Spivey | Date: | Fri, 29 Oct 2004 13:39:01 +0000 |
| Subject: | having trouble getting AUTH to work | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-15221@lists.php.net to get a copy of this message | ||
I am new to Pear so please bear with me. I've taken the example form
the documentation below and tried it. I can not get it to
authenticate. It's probably something easy fo ryou to discern but
I've not been able to and your help is much appreciated!
I've set up a test page to verify the $dsn works and it does work.
The database fields match the field names, and the structure of the
database fields is identical to the example.
The problem it has is I enter a username and password that should
work, it just keeps displaying the username and password over and
over again instead of displaying "Complete" like it should if it
authenticates.
Any ideas? Thanks!
<?php
require_once "Auth.php";
require_once 'DB.php';
function loginFunction()
{
echo "<form method=\"post\" action=\"" .
$_SERVER['PHP_SELF'] .
"\">";
echo "<input type=\"text\" name=\"username\">";
echo "<input type=\"password\" name=\"password\">";
echo "<input type=\"submit\">";
echo "</form>";
}
$dsn = "mysql://userID:password@localhost/dbName";
$a = new Auth("DB", $dsn, "loginFunction");
$a->start();
if ($a->checkAuth()) {
echo "complete";
}
?>
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail