已有83人关注
《PHP实例开发大全》(提高卷)第11章-实例/209-214/amend.php-错误提示如下:请老师解惑!
发表在PHP答疑区 2017-06-11
是否精华
版块置顶:

kk.jpg

<?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" />&nbsp;&nbsp;&nbsp;&nbsp;<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>




分享到:
精彩评论 1
木木初
学分:482 LV5
TA的每日心情
伤心
2017-09-04 22:27:56
2017-06-12
沙发

你的地址栏中的bbs_id的参数值不正确,请检查一下message.xml文件中的该属性值是否正确。

首页上一页 1 下一页尾页 1 条记录 1/1页
手机同步功能介绍
友情提示:以下图书配套资源能够实现手机同步功能
明日微信公众号
明日之星 明日之星编程特训营
客服热线(每日9:00-17:00)
400 675 1066
mingrisoft@mingrisoft.com
吉林省明日科技有限公司Copyright ©2007-2022,mingrisoft.com, All Rights Reserved长春市北湖科技开发区盛北大街3333号长春北湖科技园项目一期A10号楼四、五层
吉ICP备10002740号-2吉公网安备22010202000132经营性网站备案信息 营业执照