文本文件实现文章管理代码(2)
require "func.php";
if (
$login) {
    if (
check_user($name,$password)) {
        
setcookie ("doc[name]",$name);
        
setcookie ("doc[password]",$password);
        
redirect2 ("manage.php");
    }
    else {
        
$message"错误的用户名或者密码";
    }
}
?>
<html>
<head>
<title>文章管理登陆</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#FFFFFF">
<?php echo $message;?>
<br>
<div align="center"><font size="3" color="#336633"><b>管 理 登 陆</b></font> </div>
<form method="post" action="<?php echo $php_self;?>">
  <table width="70%" border="1" cellspacing="0" cellpadding="1" align="center" 
bordercolorlight="#999999" bordercolordark="#FFFFFF">
    <tr> 
      <td width="32%" align="right">用户名:</td>
      <td width="68%" align="left">
        <input type="text" name="name" size="16">
      </td>
    </tr>
    <tr> 
      <td width="32%" align="right">密码:</td>
      <td width="68%" align="left">
        <input type="password" name="password" size="16">
      </td>
    </tr>
    <tr> 
      <td width="32%" align="right">&nbsp;</td>
      <td width="68%" align="left">
        <input type="submit" name="login" value="确定">
      </td>
    </tr>
  </table>
</form>
</body>
</html>
// end of login.php
// manage.php
<?php
##############################################
#      文本文章发布系统代码片断
#          作者:晓风残月([email protected])
#          主页: http://safebase.yeah.net
##############################################
require "func.php";
if (
$login) {
    if (
check_user($name,$password)) {
        
setcookie ("doc[name]",$name);
        
setcookie ("doc[password]",$password);
        
redirect2 ("manage.php");
    }
    else {
        
$message"错误的用户名或者密码";
    }
}
?>
<html>
<head>
<title>文章管理登陆</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#FFFFFF">
<?php echo $message;?>
<br>
<div align="center"><font size="3" color="#336633"><b>管 理 登 陆</b></font> </div>
<form method="post" action="<?php echo $php_self;?>">
  <table width="70%" border="1" cellspacing="0" cellpadding="1" align="center" bordercolorlight="#999999" bordercolordark="#FFFFFF">
    <tr> 
      <td width="32%" align="right">用户名:</td>
      <td width="68%" align="left">
        <input type="text" name="name" size="16">
      </td>
    </tr>
    <tr> 
      <td width="32%" align="right">密码:</td>
      <td width="68%" align="left">
        <input type="password" name="password" size="16">
      </td>
    </tr>
    <tr> 
      <td width="32%" align="right">&nbsp;</td>
      <td width="68%" align="left">
        <input type="submit" name="login" value="确定">
      </td>
    </tr>
  </table>
</form>
</body>
</html>