06/02/01 12:16:27 FRDzC7Md
>>281 のソース
<?php
require_once "Auth/Auth.php";
$dsn = "mysql://user:password@localhost/database";
$authset = array(
"dsn" => $dsn,
"table" => "auth",
"usernamecol" => "username",
"passwordcol" => "password",
"cryptType" => "none"
);
$a = new Auth("DB", $authset);
// ユーザーの追加---必ずTrueが返ってくるが登録されてない。
if($a->addUser('user','pass')) {
echo "ユーザーを追加しました。";
}
$a->start();
// 認証チェック---必ずFalseが返ってくる。
if ($a->getAuth()) {
echo "ようこそ!" . $a->username . "さん<br>";
}
?>