Pear and Pear AUTH -
| From: | Erico Henrique Guimaraes | Date: | Tue, 28 Sep 2004 16:03:09 +0000 |
| Subject: | Pear and Pear AUTH - | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-14667@lists.php.net to get a copy of this message | ||
Dear Sirs,
I have Apache 2.0.48 & PHP 5.0.0RC2 & MYSQL 4.0.13-nt. First, i would like
to know if there´s any difference between PEAR 4X and PEAR 5x. Second, I
want to reinstall PEAR in PHP5 and I kindly ask you a small 'cake recipe' to
make it work and with little workarounds.
And last but not the least, i copied and pasted the below code from
http://pear.php.net/manual/en/package.authentication.auth.intro.php
.
<?php
require_once ("Auth/Auth.php");
function loginFunction()
{
echo "Welcome to this site ..."
/**
* Change the HTML output so that it fits to your
* application.
*/
echo "<b>Here you are<b></p>";
echo "<form method=\"post\" action=\"" .
$_SERVER['PHP_SELF'] . "\">";
echo "<input type=\"text\" name=\"username\">";
echo "<input type=\"password\" name=\"password\">"
/*change to supply database name*/
echo "<input type=\"text\" name=\"database">";
echo "<input type=\"submit\">";
echo "</form>";
}
/*username=fulano
password=12345
database = mysql
*/
$dsn = "mysql://user:password@localhost/database";
$a = new Auth("DB", $dsn, "loginFunction");
print $a;
$a->start();
if ($a->checkAuth()) {
echo "Login successfull!";
/**
* The output of your site goes here.
*/
}
?>
I supply my name (fulano) and password(12345) and database (mysql). The same
ones I use under DOS to query Mysql succesfully. These assignments really
work fine with another front-end, namely MySQL-Front .But the page always
returns nothing. In this case it should display "Login Successfull" but just
prompt on and on the screen again. I wonder what I fail to understand 'cause
I read lists, manuals, docs but there´s something in $dsn =
"mysql://user:password@localhost/database" or somwhere else I stil can see
to make it work.
best regards
Érico