| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 655 人关注过本帖
标题:回复页面代码错哪了啊?
只看楼主 加入收藏
dengjifu
Rank: 1
等 级:新手上路
帖 子:60
专家分:0
注 册:2007-5-16
收藏
 问题点数:0 回复次数:10 
回复页面代码错哪了啊?

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="cndb.asp"-->
<%
dim reback,iid
iid=request("id")
reback=request.form("reback")
if reback<>""and id<>"" then
sql="select * from cndb where id="&iid
rs.open sql,cn,3,2
if not rs.eof then
rs.addnew
rs("reback")=reback
rs.update
rs.close
set rs=nothing
response.Redirect("留言板.asp")
response.end
else
response.Write("更新不了")
end if
end if
%>
<!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>无标题文档</title>
<link href="作品/images/style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<form id="form" name="form" method="post" action="reback.asp">
<table width="300" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="99" height="83"><div align="center">回复内容</div></td>
<td width="201"><label>
<textarea name="reback" id="reback" cols="50" rows="8" class="bg_b05"></textarea>
</label></td>
</tr>
<tr>
<td height="43" colspan="2"><label>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" name="Submit" value="回复" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="reset" name="Submit2" value="重置" />
</label></td>
</tr>
</table>
</form>
</body>
</html>

搜索更多相关主题的帖子: 页面 代码 
2007-06-08 13:27
dengjifu
Rank: 1
等 级:新手上路
帖 子:60
专家分:0
注 册:2007-5-16
收藏
得分:0 
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="cndb.asp"-->
<%
dim reback,iid
iid=request("id")
reback=request.form("reback")
if reback<>""and id<>"" then
sql="select * from cndb where id="&iid
rs.open sql,cn,3,2
if not rs.eof then
rs.addnew
rs("reback")=reback
rs.update
rs.close
set rs=nothing
response.Redirect("留言板.asp")
response.end
else
response.Write("更新不了")
end if
end if
%>
2007-06-08 13:28
dengjifu
Rank: 1
等 级:新手上路
帖 子:60
专家分:0
注 册:2007-5-16
收藏
得分:0 
dim reback,iid
iid=request("id")
reback=request.form("reback")
if reback<>""and id<>"" then
sql="select * from cndb where id="&iid
rs.open sql,cn,3,2
if not rs.eof then
rs.addnew
rs("reback")=reback
rs.update
rs.close
set rs=nothing
response.Redirect("留言板.asp")
response.end
else
response.Write("更新不了")
end if
end if
2007-06-08 13:29
dengjifu
Rank: 1
等 级:新手上路
帖 子:60
专家分:0
注 册:2007-5-16
收藏
得分:0 
我这样写提示为 语法错误 (操作符丢失) 在查询表达式 'id=' 中。
2007-06-08 13:30
hangxj
Rank: 6Rank: 6
等 级:贵宾
威 望:29
帖 子:2045
专家分:0
注 册:2006-4-10
收藏
得分:0 
以下是引用dengjifu在2007-6-8 13:29:30的发言:
dim reback,iid
iid=request("id")
reback=request.form("reback")
if reback<>""and iid<>"" then
sql="select * from cndb where id="&iid
rs.open sql,cn,3,2
if not rs.eof then
rs.addnew
rs("reback")=reback
rs.update
rs.close
set rs=nothing
response.Redirect("留言板.asp")
response.end
else
response.Write("更新不了")
end if
end if

然后就是你的request("id") 中的id没有传值过来,很老的问题了,自己检查一下


http://www./
2007-06-08 13:41
dengjifu
Rank: 1
等 级:新手上路
帖 子:60
专家分:0
注 册:2007-5-16
收藏
得分:0 
讲清楚点好吗?
2007-06-08 13:43
shdyh977
Rank: 1
等 级:新手上路
威 望:1
帖 子:109
专家分:0
注 册:2007-5-22
收藏
得分:0 
if reback<>""and id<>"" then
上边这句中的id是什么?没有赋值,应该写成iid吧
2007-06-08 13:44
lq7350684
Rank: 6Rank: 6
等 级:贵宾
威 望:20
帖 子:5089
专家分:98
注 册:2006-11-6
收藏
得分:0 
dim reback,iid
reback=request.form("reback")
if reback<>""and id<>"" then
sql="select * from cndb where id="&request("id")
rs.open sql,cn,3,2
if not rs.eof then
rs.addnew
rs("reback")=reback
rs.update
rs.close
set rs=nothing
response.Redirect("留言板.asp")
response.end
else
response.Write("更新不了")
end if
end if
2007-06-08 13:44
gaohanxiong
Rank: 1
等 级:新手上路
帖 子:67
专家分:0
注 册:2007-3-12
收藏
得分:0 
if reback<>""and id<>"" then 这句错了。
应该是
if reback<>""and iid<>"" then

明白了吗?

2007-06-08 13:45
dengjifu
Rank: 1
等 级:新手上路
帖 子:60
专家分:0
注 册:2007-5-16
收藏
得分:0 
id就是要回复那篇文章的id 啊,reback是回复提交的内容
2007-06-08 13:48
快速回复:回复页面代码错哪了啊?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012592 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved