[php] pear auth + mdb2 Dúvida!

PHP:
<?php
 
require_once '../libs/PEAR.php';
require_once '../libs/MDB2.php';
require_once 'Auth.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 = "pgsql://postgres:lpass@localhost/moveis";
$a = new Auth("MDB2", $dsn, "loginFunction");
 
$a->start();
 
echo "Everybody can see this text!<br />";
 
if (!isset($_GET['login'])) {
echo "<a href=\"test.php?login=1\">Click here to log in</a>\n";
}
 
if ($a->getAuth()) {
echo "One can only see this if he is logged in!";
}
 
 
?>

Pessoal, alguem vê alguma coisa mal nisto? já estou à horas nisto e não funciona!!! t:005::005::005:
As livrarias estão nos sítios correctos.
 
Última edição pelo moderador:
Back
Topo