您现在的位置: 军旅同心-旅游自驾-军旅文学 >> 读书赏析 >> 学习园地 >> 电脑网络 >> 技术文章 >> 正文
用Access制作一个功能完善的论坛(源程序)
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005-9-10 14:08:59
></table>

<%
page = Request( "pg" )
IF page = "" THEN page = 1


readydbCon

SET RS = Server.CreateObject( "ADODB.Recordset" )
RS.ActiveConnection = Con
RS.CursorType = adOpenStatic
RS.Open "select m_id, m_email, m_subject, m_numreplies, m_entrydate FROM messages WHERE m_reply=-1 ORDER
by m_id DESC"
RS.PageSize = messagesApage
RS.AbsolutePage = page
IF RS.EOF THEN
%>
<font face="Arial">There are no messages</font>
<%
ELSE
%>
<table width="100%" border=0 cellpadding=4 cellspacing=0>
<tr>
<td>
<font size="2" color="darkgreen"><b>AUTHOR</b></font>
</td>
<td>
<font size="2" color="darkgreen"><b>SUBJECT</b></font>
</td>
<td>
<font size="2" color="darkgreen"><b>REPLIES</b></font>
</td>
<td>
<font size="2" color="darkgreen"><b>DATE POSTED</b></font>
</td>
</tr>
<%
WHILE NOT RS.EOF and counter < RS.PageSize
%>
<tr>
<td><font size="2" ><%=showUser( RS( "m_email" ) )%></font></td>
<td><a href="message.asp?id=<%=RS( "m_id" )%>&pg=<%=page%>" target="message"><font
size="2"><%=Server.HTMLEncode( RS( "m_subject" ) )%></font></a></td>
<td>
<font size="2"><%=RS( "m_numreplies" )%> </font>
<% IF cINT( RS( "m_numreplies" ) ) > 0 THEN %>
<a href="message.asp?id=<%=RS( "m_id" )%>&pg=<%=page%>#replies"
target="message"><font size="2">view</font></a>
<% END IF %>
</td>
<td><font size="2"><%=RS( "m_entrydate" )%></font></td>
</tr>
<%
counter = counter+1
RS.MoveNext
WEND
%>
</table>
<%
IF RS.PageCount > 1 THEN
%>
<p><font size="2" color="#666666">View Page: </font>
<%
FOR i = 1 to RS.PageCount
IF i = cINT( page ) THEN
%>
<font size="2"><b><%=i%></b></font>
<%
ELSE
%>
<a href="discussframes.asp?pg=<%=i%>" target="topframe"><font size="2"><%=i%></font></a>
<%
END IF
NEXT
END IF
END IF
RS.Close
Con.Close
%>
</body>
</html>
----------------------------------------------







Listing 7.0 - post.asp
-------------------------------
<%
page = TRIM( Request( "pg" ) )
id = TRIM( Request( "id" ) )
email = TRIM( Request( "email" ) )
subject = TRIM( Request( "subject" ) )
message = TRIM( Request( "message" ) )
%>
<HTML>
<HEAD>
<TITLE>Post</TITLE>
</HEAD>
<BODY bgcolor="#000000">


<form method="post" action="discussframes.asp" target="topframe">
<input name="pg" type="hidden" value="<%=page%>">
<% IF id = "" THEN %>
<input name="addm" type="hidden" value="-1">
<% ELSE %>
<input name="addm" type="hidden" value="<%=id%>">
<% END IF %>


<center>
<table width="640" cellpadding="4" cellspacing=0 border=0>
<tr>
<td align="right" nowrap>
<font face="Arial" size="2" color="yellow"><b>Your Email Address:</b></font>
</td>
<td>
<input name="email" size="60" maxlength="255" value="<%=Server.HTMLEncode( email )%>">
</td>
</tr>
<tr>
<td align="right">
<font face="Arial" size="2" color="yellow"><b>Message Subject:</b></font>
</td>
<td>
<input name="subject" size="60" maxlength="50" value="<%=Server.HTMLEncode( subject )%>">
</td>
</tr>
<tr>
<td align="right" valign="top">
<font face="Arial" size="2" color="yellow"><b>Message:</b></font>
</td>
<td>
<textarea name="message" cols="60" rows="13" wrap="virtual"><%=Server.HTMLEncode( message )%
></textarea>
</td>
</tr>
<tr>
<td align="right" colspan=2>
<table border=0 cellpadding=2 cellspacing=0>
<tr>
<td>
<input type="submit" value="Post Message" style="color:blue;font-family:Arial;font-
weight:bold">
</td>
</form>
<form action="discussframes.asp" target="topframe">
<td>
<input type="submit" value="Cancel Message" style="color:blue;font-family:Arial;font-
weight:bold">
</td>
</tr>
</table>
</td>
</tr>
</table>
</BODY>
</HTML>

上一页  [1] [2] 


更多
免责声明:作品版权归所属媒体与作者所有!!本站刊载此文不代表同意其说法或描述,仅为提供更多信息。如果您认为我们侵犯了您的版权,请告知!本站立即删除。有异议请联系我们。
文章录入:烟灰缸    责任编辑:烟灰缸 
网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
| 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 网站地图 | 版权申明 | 网站公告 | 管理登录 |