Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > c96eee2d4b70373ae7d30d11455ae99f > files > 4

php-pear-Auth_HTTP-2.1.6-7mdv2008.1.noarch.rpm

<?php
require_once "Auth/HTTP.php";
define('DSN','sqlite://dummy:@localhost//tmp/user.db?mode=0644');

$options = array('dsn'=>DSN);
$auth = new Auth_HTTP("DB", $options);

$auth->setRealm('dummy', 'sample');
$auth->start();

?>
<html>
<head><title>HTTP Basic authentication test for simple case</title></head>
<body>
<?php
print "auth: ".$auth->authType."<br />";
print "username: ".$auth->username."<br />";
print "password: ".$auth->password."<br />";
print "auth: ".print_r($auth->auth)."<br />";
if($auth->getAuth()) {
  print "authentication is succeeded.<br />";
}
?>
</body></html>