帮忙看下程序 问题出哪儿了,谢谢!
我是在做一个论坛 做到发主题贴了,数据都能写入 就是不能显示出来 不知道为什么?高手帮忙<!--#include file="conn.asp"-->
<%
if request.QueryString("action")="add" then
if request.cookies("username")="" then
response.write ("<script>window.alert('没有登陆不能发帖!');;history.back();</script>")
response.end
end if
if request.Form("usertitle")="" then
response.write ("<script>window.alert('标题不能为空!');;history.back();</script>")
response.end
end if
if request.Form("usercontent")="" then
response.write ("<script>window.alert('内容不能为空!');;history.back();</script>")
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select * from usercontent"
rs.open sql,conn,1,3
rs.addnew
rs("usertitle")=request.Form("usertitle")
rs("usercontent")=request.Form("usercontent")
rs("syxl")=request.QueryString("fid")
rs("username")=request.Cookies("username")
rs("time")=now()
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write ("<script>window.alert('添加成功!');location='add_title.asp?fid="&request("fid")&"';</script>")
response.end
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<% Set rs1 = server.CreateObject("ADODB.Recordset")
sql1="select * from xiaolei"
rs1.Open sql1,conn,1,1%>
<table width="100%" height="30" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFCC33">
<tr>
<td width="830">标题</td>
<td width="130">作者</td>
<td width="130">回复/查看</td>
<td width="140">最后发表</td>
</tr>
</table>
<% Set rs = server.CreateObject("ADODB.Recordset")
sql="select * from usercontent where syxl="&rs1("id")&" order by id desc"
rs.Open sql,conn,1,1
if not rs.eof then
do while not rs.eof %>
<table width="100%" height="30" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="830"><%=rs("usertitle")%></td>
<td width="130"><%=rs("username")%></td>
<td width="130"> </td>
<td width="140"> </td>
</tr>
</table>
<%
rs.movenext
loop
end if
rs.close
set rs=nothing
rs1.close
set rs1=nothing
%>
<br />
<br />
<br />
<table width="100%" height="50" border="0" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#FFFFCC"> 快速发新话题</td>
</tr>
</table>
<table width="100%" border="0" align="right" cellpadding="5" cellspacing="0">
<form action="add_title.asp?action=add&fid=<%=request("id")%>" method="post" name="form1" id="form1">
<tr>
<td>标题</td>
<td>
<input type="text" name="usertitle" id="username">
</td>
</tr>
<tr>
<td>内容</td>
<td><textarea name="usercontent" cols="50" rows="10"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="发表帖子" />
<input type="reset" name="Submit2" value="重置" /></td>
</tr>
</form>
</table>
</body>
</html>
<%
conn.close
set conn=nothing
%>