<?php session_start();?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>PHP+XML留言板</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.3.2.js"></script>
<script src="js/register.js"></script>
</head>
<body style="text-align:center">
<div style="width:777px; height:154px;"><img src="images/<?php if(@$_SESSION[nickname]==""){echo 'message_022.jpg';}else{ echo 'message_02.jpg';}?> " width="777" height="154" border="0" usemap="#Map" />
<map name="Map" id="Map">
<area shape="rect" coords="572,132,633,149" href="<?php if(@$_SESSION[nickname]==""){echo 'register.php';}else{ echo 'index.php';}?>" />
<area shape="rect" coords="645,132,708,150" href="<?php if(@$_SESSION[nickname]==""){echo 'enter.php';}else{ echo 'insert.php';}?>" />
</map></div>
<div style="width:777px; height:61px;"><?php if(@$_SESSION['nickname']!=""){?>
<img src="images/message_07.jpg" width="170" height="61" border="0" /> <a href="admin_export.php?nickname=<?php echo @$_SESSION[nickname];?>"><img src="images/message_09.jpg" width="170" height="61" border="0" /></a><a href="logout.php"><img src="images/message_08.jpg" width="170" height="61" border="0" /></a><?php }?></div>
<div style="width:777px; height:27px;"><img src="images/message(1).jpg" width="777" height="27" /></div>
<div style="width:777px; height:20px;"></div>
<?php
class Message_XML extends DomDocument{
public function __construct() {
parent:: __construct();
$this->load("xml_data/message.xml");
}
public function update_message($bbs_id){
$xpath = new DOMXPath($this);
$Node_Record = $xpath->query("//record[bbs_id=$bbs_id]");
$K=0;
foreach ($Node_Record->item(0)->childNodes as $articles) {
$Field[$K]=iconv("UTF-8","GB2312",$articles->textContent);
$K++;
}
?>
<div style="width:777px;">
<form name="form_reg" method="post" action="amend_ok.php?bbs_id=$bbs_id" onsubmit="return insert_check();">
<div style="width:600px; height:25px; border:solid #d4d4d4 1px; ">
<li style="width:100px; padding-top:6px; float:left; display:inline" class="right_div">昵称:</li>
<li class="left_div" style="width:300px; border-left:solid #d4d4d4 1px; padding-top:1px; float:left; display:inline"><input type="text" name="nickname" value="<?php echo $Field[3];?>" readonly id="nickname" size="28" >
</li>
<li id="chknew_nickname" style="color:#FF0000; width:190px; border-left:solid #d4d4d4 1px; padding-top:6px; float:left; display:inline"></li>
</div>
<div style="width:600px; height:25px; border-left:solid #d4d4d4 1px; border-bottom:solid #d4d4d4 1px; border-right:solid #d4d4d4 1px; ">
<li style="width:100px; padding-top:6px; float:left; display:inline" class="right_div">标题:</li>
<li class="left_div" style="width:300px; border-left:solid #d4d4d4 1px; padding-top:1px; float:left; display:inline"><input type="text" name="subject" id="subject" value="<?php echo $Field[1]; ?>" size="33">
</li>
<li id="chknew_subject" style="color:#FF0000; width:190px; border-left:solid #d4d4d4 1px; padding-top:6px; float:left; display:inline"></li>
</div>
<div style="width:600px; height:25px; border-left:solid #d4d4d4 1px; border-bottom:solid #d4d4d4 1px; border-right:solid #d4d4d4 1px; ">
<li style="width:100px; padding-top:6px; float:left; display:inline" class="right_div">内容:</li>
<li class="left_div" style="width:450px; border-left:solid #d4d4d4 1px; padding-top:1px; float:left; display:inline">
<textarea name="content" id="content" cols="50" rows="5" ><?php echo $Field[2]; ?></textarea>
</li>
</div>
<div style="width:600px; height:25px; border-left:solid #d4d4d4 1px; border-bottom:solid #d4d4d4 1px; border-right:solid #d4d4d4 1px; ">
<li class="center_div" style="width:300px; height:30px; border-left:solid #d4d4d4 1px; padding-top:7px; float:left; display:inline"><input type="image" src="images/message(2).jpg">
<input type="hidden" name="bbs_date" value="<?php echo date("Y-m-d H:i:s"); ?>" />
<input type="hidden" name="bbs_ip" value="<?php echo getenv('REMOTE_ADDR');?>" />
<input type="hidden" name="bbs_id" value="<?php echo $bbs_id; ?>" />
</li>
<li class="center_div" style="color:#FF0000; width:190px; border-left:solid #d4d4d4 1px; padding-top:7px; float:left; display:inline"><img src="images/message(3).jpg" width="70" height="22" onClick="form_reg.reset()" style="cursor:hand"/></li>
</div>
</form>
</div>