利用ASP打造网站论坛DIY(3)
2006-04-08 11:59:40 来源:WEB开发网当点击了相应文章的联结后,就进入此文章的处理页面managearticle.asp:
< %
articleid=request("articleid")
boardid=request("boardid")
if session("beenthere")< >boardidthen response.redirect "forums.asp"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft AccessDriver (*.mdb)};dbq=" & Server.MapPath("bbssystem.mdb")
Set cmd = Server.CreateObject("ADODB.Command")
Set cmd.ActiveConnection = conn
cmd.CommandText = "按id查询文章"
ReDim param(0)
param(0) = CLng(articleid)//注:Clng 不可忽略
Set rs = cmd.Execute( ,param )
author=rs("作者id")
title=rs("标题")
data=rs("日期")
rate=rs("推荐度")
boardid=rs("看板id")
topicid=rs("主题id")
boardname=rs("看板名")
topicname=rs("主题名")
content=rs("内容")
content=replace(content,vbCrlf,"</p>< p>")
content="< p>" & content& "< /p>"
set cmd=nothing
%>
< html>
< head>
< title>Untitled Document< /title>
< meta http-equiv="Content-Type"content="text/html; charset=GB2312">
< /head>
< body bgcolor="#E9E9E4">
< table width="89%" border="0"cellspacing="0" cellpadding="0"align="center">
< tr bgcolor="#CCCCCC">
< td>作者:< font color="#FF3366"><a href="qauthor.asp?author=< %=author%>">< %=author%> < /a>< /font>发表日期:< font color="#FF3333"><%=data%>< /font>
看板:< font color="#FF3333"><a href="qboard.asp?boardid=< %=boardid%>">< %=boardname%>< /a>< /font>板主推荐:< font color="#FF3333">#rate#</font>< /td>
< /tr>
< tr bgcolor="#CCCCCC">
< td>标题:< font color="#FF3333"><%=title%>
主题:< a href="qtopic.asp?topicid=<%=topicid%>"> < %=topicname%>< /a> < /font>< /td>
< /tr>
< tr valign="top">
< td>
< hr>
< font color="#FF3366">文章内容:< /font>< br>
< br>
< font color=blue>< %response.writecontent%>< /font>
< br>
< hr>
< /td>
< /tr>
< tr valign="top">
< form method="post" action="manageresult.asp">
< td height="18">
< table width="100%" border="1"cellspacing="1" cellpadding="1">
< tr>
< td width="29%">
< div align="right">
< input type="hidden" name="boardid"value="< %=boardid%>">
< input type="hidden" name="topicid"value="< %=topicid%>">
< input type="hidden" name="articleid"value="< %=articleid%>">
文章处理:< /div>
< /td>
< td width="12%" bordercolor="#006666">删除:
< input type="radio" name="manage"value=1>
< /td>
< td width="30%" bordercolor="#006666">发表:
< input type="radio" name="manage"value=2>
推荐等级
< select name="select">
< option value="1">1</option>
< option value="2">2</option>
< option value="3" selected>3</option>
< option value="4">4</option>
< option value="5">5</option>
< /select>
< /td>
< td width="20%" bordercolor="#006666">以后再处理:
< input type="radio" name="manage"value=3>
< /td>
< td width="9%">
< input type="submit" name="Submit"value="确定">
< /td>
< /tr>
< /table>
< /td>
< /form>
< /tr>
< /table>
< /body>
< /html>
< %
set rs=nothing
conn.close
set conn=nothing
%>
更多精彩
赞助商链接