bbscontent.asp

来自「这是我自己设计的一个资源管理系统」· ASP 代码 · 共 69 行

ASP
69
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>资源管理系统</title>
</head>

<body>
<%
  dim bbsID,authorID,author,bbsT,title,content
  bbsID=request("bbsID")
  
  set conn=server.CreateObject("adodb.connection")
  conn.open"DBSource","sa",""
  sql="select * from TBbs where bbs_id="&bbsID
  set rs=conn.execute(sql)
  if not rs.eof then
     authorID=rs("author_id")
	 title=rs("bbs_title")
	 bbsT=rs("bbs_time")
	 content=rs("bbs_content")
	 
	 author="暂无"
	 set rs1 = conn.execute("select real_name from TUser where user_id="&authorID)
	 if not rs1.eof then
	  author=rs1("real_name")
	 end if
%>
<table width="100%" border="1">
  <tr> 
    <td width="14%">标题</td>
    <td width="86%"><%=title%>(作者:<%=author%>时间:<%=bbsT%>)
	<a href="bbsReply0.asp?bbsID=<%=bbsID%>&title=<%=title%>">回复</a></td>
  </tr>
  <tr> 
    <td>内容</td>
    <td><%=content%></td>
  </tr>
  <tr>
    <td>回复</td>
    <td><%
	sql="select * from TBbs where parent_id="&bbsID
    set rs2=conn.execute(sql)
    do until rs2.eof
     authorID=rs2("author_id")
	 title=rs2("bbs_title")
	 bbsT=rs2("bbs_time")
	 content=rs2("bbs_content")
	 
	 author="暂无"
	 set rs3 = conn.execute("select real_name from TUser where user_id="&authorID)
	 if not rs3.eof then
	  author=rs3("real_name")
	 end if
	%>
	<%=title%>(作者:<%=author%>,时间:<%=bbsT%>)<br>
	<%=content%>
	<hr>
	<%
	  rs2.movenext
	   loop
	%>
	</td>
  </tr>
</table>
<%end if%>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?