<?ob_start();
session_start();?>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<form action='login.php' method='post' name='form1'>
username : <input type='text' name='username'>
password : <input type='password' name='password'>
<input type='submit' name='send'>
</form>
<?
$user = 'admin';
$pass = '12345';
if($username != null && $password != null){
// 如果使用者 輸入了帳號密碼
if($user == $username && $pass == $password){
$_SESSION['username'] = $user;
echo '<meta http-equiv=REFRESH CONTENT=1;url=index.php>';
}else{
echo "帳號錯誤!!";
}
}
?> |