【PHP】PEAR Part2 ..
[2ch|▼Menu]
282:nobodyさん
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>";
}
?>


次ページ
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

4358日前に更新/213 KB
担当:undef