Ciao a tutti , non riesco a fare girare un esempio sulla suddeta classe. il codice è il seguente:
config.inc.php
--------------
codice:
<?
require_once "/Command/Auth.php";
function loginFunction()
{
/*
* Change the HTML output so that it fits to your
* application.
*/
echo "<form method=\"post\" action=\"test.php\">";
echo "<input type=\"text\" name=\"username\">";
echo "<input type=\"password\" name=\"password\">";
echo "<input type=\"submit\">";
echo "</form>";
}
$params = array ("dsn" => "mysql://root:matrix@localhost/loginpage",
"table" => "auth",
"usernamecol" => "username",
"passwordcol" => "password");
$a = new Auth("DB",$params,"loginFunction");
$a->start();
?>
index.php
---------
codice:
<?
require_once "config/config.inc.php";
if($_GET['action']=="logout" && $a->checkAuth()){
$a->logout();
$a->start();
}
if($a->getAuth()){
echo "Solo gli utenti registrati possono accedere qui
";
echo '<a href=index.php?action=logout> Logout</a>;
}
?>
Non riesco a capire cosa c'è che non và...grazie