Warning: Auth::include_once(Auth/Container/DB.php) [auth.include-once]: failed to open stream: No such file or directory in C:\wamp\bin\php\php5.2.6\PEAR\Auth.php on line 468 Warning: Auth::include_once() [function.include]: Failed opening 'Auth/Container/DB.php' for inclusion (include_path='.;C:\wamp\bin\php\php5.2.6\PEAR;C:\wamp\www\TESTS') in C:\wamp\bin\php\php5.2.6\PEAR\Auth.php on line 468 Fatal error: Class 'Auth_Container_DB' not found in C:\wamp\bin\php\php5.2.6\PEAR\Auth.php on line 469
<?php // Dans ce test, le fichier est nommé "test.php". require_once "Auth.php"; function loginFunction() { /* * Adaptez le HTML à votre application. */ echo "<form method=\"post\" action=\"test.php?login=1\">"; echo "<input type=\"text\" name=\"username\">"; echo "<input type=\"password\" name=\"password\">"; echo "<input type=\"submit\">"; echo "</form>"; } if (isset($_GET['login']) && $_GET['login'] == 1) { $optional = true; } else { $optional = false; } $options = array( 'dsn' => "mysql://user:password@localhost/database", ); $a = new Auth("DB", $options, "loginFunction", $optional); $a->start(); // Ligne fautive : si je la commente, je n’ai pas d’erreur // ... mais rien non plus, forcement echo "Tout le monde peut lire ce texte !<br />"; if (!isset($_GET['login'])) { echo "<a href=\"test.php?login=1\">Cliquez ici pour vous identifier.</a>\n"; } if ($a->getAuth()) { echo "Ce texte n'est affiché que si vous êtes identifié !"; } ?>