<?php
session_start();
$id="admin";
$pass="12345";
$tool="已登入 [<input type='submit' value='登出'>]
<p><a href='index.php'>重新播放</a></p>";
$form="
<form>
<table>
<tr><td>帳號:</td><td></td></tr>
<tr><td>密碼:</td><td></td></tr>
<tr><td align='center'>
<input type='submit' value='登入'>
</td></tr>
</table>
</form>";
if($_GET['op']=='logout'){
$_SESSION['login']=false;
}else{
if($_POST['user_id']==$id and $_POST['passwd']==$pass){
$_SESSION['login']=true;
}else{
$_SESSION['login']=false;
}
}
header("location:index.php");
?>