<% If RequestFormStr("action")="save" Then Call save() End If Dim id,strContent,strTitle id=RequestQueryNum("id") password2=RequestFormStr("password2") Set rs=conn.Execute("Select * From notebook Where id="&id) strTitle=rs("title") strContent=rs("content") hits=rs("hits") password=rs("password") posttime=rs("posttime") Set rs=nothing %> <%=strTitle%>

<%=strTitle%>

发表日期:<%=Year(posttime) &"-"&Month(posttime)&"-"&Day(posttime)%>  点击:<%=hits%>次
<% If password<>"" Then If password2<>"" then If password=password2 Then Response.Write strContent conn.Execute("update notebook set hits=hits+1 Where id="& id &"") Else Call MessageBox("密码不正确!","") Response.End End If Else %>
此文章作者已经加密,请输入密码:
<% End If Else Response.Write strContent conn.Execute("update notebook set hits=hits+1 Where id="& id &"") End If %> <% Call show() Randomize codes = Int((9999 - 1000 + 1) * Rnd + 1000) session("codes")=codes If siteIsComment=True then %>
发表评论:
昵称
内容:
验证码: <%=codes%>
<% End If %> <% Sub save() title=requestFormStr("title") content=requestFormStr("content") codes=requestFormNum("codes") id=requestFormNum("id") 'response.write title&"
"&content&"
"&codes&"
" If siteIsComment=False Then Call MessageBox("评论功能已经关闭!","") response.End End If If title="" Or title="昵称" Then Call MessageBox("请输入您的昵称!","") response.End End If If content="" Then Call MessageBox("请输入评论内容!","") response.End End If If codes<>session("codes") Then Call MessageBox("验证码不正确!","") response.End End If sql="select * from comment" set rs=Server.CreateObject("ADODB.Recordset") rs.open sql,conn,1,3 rs.addNew rs("title")=title rs("content")=content rs("reid")=id rs.Update Set rs=Nothing Call MessageBox("评论成功!","articleframe.asp?id="&id) response.End End Sub Sub show() sql="Select * From comment where reid="& id &" order by id desc" Set mypage=new xdownpage '创建对象 mypage.getconn=conn '得到数据库连接 mypage.getsql=sql mypage.pagesize=20 '设置每一页的记录条数据为5条 set rs=mypage.getrs() '返回Recordset %> <% for i=1 to mypage.pagesize If rs.eof Then Exit for End If %> <% rs.MoveNext Next %>
昵称:<%=rs("title")%>评论时间:<%=rs("posttime")%>
评论内容:
<%=HTMLEncode(rs("content"))%>
<% End Sub %>