各位前輩大家好:
小弟在繼承AUTH使用自訂表單出了問題,不知那兒出了差錯?
-----------------------MyAuth.php-----------------------
<?php
require_once 'auth.php';
class MyAuth extends Auth
{
function __construct($showLogin=true)
{
$options=array(
'table'=>'users',
'dsn'=>"mysql://root:123456@localhost/jana?charset=utf8",
db_fields=>'*');
parent::Auth('mdb2',$options,'custom_login',showLogin);
}
function custom_login()
{
echo <<<LOGIN_FORM
<form method="POST" action="{$_SERVER['PHP_SELF']}">
<ul>
<li>會員登入</li>
<li>帳號:<input type="text" name="username" size="20" /></li>
<li>密碼:<input type="text" name="password" size="20" /><</li>
<li><input type="text/css' name="submit"></li>
</ul>
<a href="register.php">立即註冊</a></br>
<a href="forget.php">忘記密碼</a></br>
<a onclick="history.go(-1)" type="button" vlaue="回上一頁" >
</form>
LOGIN_FORM;
}
}
?>
-----------------------------------login.php----------------------------------
<?php
header('Content-Type:text/html;charset=utf-8');
require_once 'MyAuth.php';
$a=new MyAuth();
$a->start();
?>
在網頁執行login.php之後,只會出現預設的表單,而不會出現custom_login函式自訂的表單@@