<link rel="stylesheet" href="../css/css.css" />
<script language="JavaScript">
function check(myform){
	if(myform.txt_word.value==""){
		alert("敏感词不能为空");myform.txt_word.focus();return false;
	}
}
</script>

<table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="3"><?php include("m_header.html");?></td>
  </tr>
  <tr>
    <td width="190" valign="top" bgcolor="#f0f0f0"><?php include("m_left.php");?></td>
    <td width="757" align="center" valign="top" bgcolor="#FFFFFF"><table width="100%" height="59" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td background="../images/addword.jpg">&nbsp;</td>
      </tr>
    </table>
    <table width="700"  border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="613" height="223" align="center"><br />
            <table width="700" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td align="center"><form action="" method="post"  name="myform">
                    <table width="560" border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td valign="middle" align="right" width="20%">添加敏感词：<br /></td>
                        <td width="80%"><input name="txt_word" type="text" id="txt_word" size="50" />
                          &nbsp;
                        <input name="btn_tj" type="submit" class="btn1" id="btn_tj" onclick="return check(myform);" value="添加敏感词" /></td>
                      </tr>
                    </table>
                </form></td>
              </tr>
          </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="3"><?php include("footer.html");?></td>
  </tr>
</table>
<?php
if($_POST){
$filename="../filterwords.txt";
if(is_writable($filename)){
	$file=fopen($filename,'r+');
}
else{
	echo "文件".$filename."不可写";
}
//在文件尾写文件
fseek($file,0,SEEK_END);
$word=$_POST[txt_word];
fwrite($file,$word);
fwrite($file,"\r\n");
fclose($file);
}
?>