每次留言以后,单击提交以后,并不立刻显示刚才提交的留言,而是在提交下一次留言时才显示上一次的内容,而本次留言又只能在提交下一次留言时才显示,请问是什么原因呀?
求救了!全部代码在下面!
<!--#include file="connection.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<a href="shicigefu.asp?page_no=<%=session("page_no")%>">返回首页</a>
<%
dim id1,sq2,z
id1=request("id")
sq2="select wenzhang,xingming,timu,shijian from wenzhang where id="&id1
set z=cn.execute(sq2)
%>
<table>
<tr>
<td>主题</td>
<td><%=z("timu")%></td>
</tr>
<tr>
<td>内容</td>
<td><%=z("wenzhang")%></td>
</tr>
<tr>
<td align="right"><%=z("xingming")%>发表于<%=z("shijian")%></td>
</tr>
</table>
<%
dim zz,sq3
sq3="select * from wenzhang where parent_id="&id1&" order by shijian desc"
set zz=cn.execute(sq3)
dim i
i=0
do while not zz.eof
i=i+1
%>
<table>
<caption align="left">回复<%=i%></caption>
<tr>
<td>主题</td>
<td><%=zz("timu")%></td>
</tr>
<tr>
<td>内容</td>
<td><%=zz("wenzhang")%></td>
</tr>
<tr>
<td align="right"><%=zz("xingming")%>发表于<%=zz("shijian")%></td>
</tr>
</table>
<%
zz.movenext
loop
%>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><form name="form1" method="post" action="xianshi.asp">
<textarea name="huifu"></textarea>
<input name="id" type="hidden" value="<%=id1%>">
<br>
<input type="submit" name="Submit" value="提交">
</form></td>
</tr>
</table>
<%
if request.form("huifu")<>"" then
dim wen,ceng,parent,ip
wen=request.form("huifu")
ceng=1
parent=request.form("id")
ip=request.ServerVariables("REMOTE_ADDR")
dim sq4,sq5
sq4="insert into wenzhang(wenzhang,parent_id,ceng,ip) values('"&wen&"','"&parent&"','"&ceng&"','"&ip&"')"
cn.execute(sq4)
sq5="update wenzhang set huifushu=huifushu+1 where id="&request.form("id")
cn.execute(sq5)
cn.close
end if
%>
</body>
</html>
[此贴子已经被作者于2006-6-25 20:14:12编辑过]