Index.asp代码如下:
<%
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open"select * from note_comment order by id desc",conn,1,3
if rs.eof and rs.bof then
response.redirect"book_write.asp"
else
if counts=0 or counts="" then counts=10
rs.pageSize=counts
allpages=rs.pageCount
page=Request("page")
if not isNumeric(page) then page=1
if isEmpty(page) or cint(page)<1 then
page=1
elseif Cint(page)>=allpages then
page=allpages
end if
rs.AbsolutePage=page
Do While Not rs.eof
UserName=rs("Name")
Comments=rs("Comment")
Reply=rs("Reply")
Usermail=rs("Email")
url=rs("Url")
replyname=rs("ReplyNsme")
I=I+1
temp=RS.RecordCount-(page-1)*rs.pageSize-I+1
%>
Book_write.asp代码如下:
<%
if request("send")="ok" then
username=trim(request.form("username"))
usermail=trim(request.form("usermail"))
if username="" or request.form("Comments")="" or request.form("subject")="" then
response.write"<script>alert('填写资料不完整,请检查后重新输入!');history.back();</script>"
response.end
end if
if mailyes=0 then
if Instr(usermail,".")<=0 or Instr(usermail,"@")<=0 or len(usermail)<10 or len(usermail)>50 then
response.write"<script>alert('您输入的电子邮件地址格式不正确,请检查后重新输入!');history.back();</script>"
response.end
end if
end if
if len(request.form("subject"))>subjectmaxlength then
response.write"<script>alert('留言主题太长了,请不要超过"&subjectmaxlengh&"个字符!');history.back();</script>"
response.end
end if
if len(request.form("Comments"))>maxlengh then
response.write "<script>alert('留言内容太长了,请不要超过"& maxlength &"个字符!');history.back();</script>"
response.end
end if
set rs=nothing
response.write"<script>alert('留言提交成功,单击“确定”返回留言列表!');location.href='index.asp';</script>"
response.end
end if
%>
Admin_login.asp代码如下:
<%
if request.QueryString("act")="login" then
user=Request.Form("username")
pass=Request.Form("password")
Set NArs=Server.CreateObject("Adodb.RecordSet")
sq1="Select * from note_admin where Admin='"& user &"'and pwd='"& pass &"'"
NArs.open sq1,conn,1,1
If not(NArs.bof and NArs.eof) Then
Session("login")="ok"
Session("user")=NArs("Admin")
www.751com.cn 如下:
<%
dim rs,msg_per_page
dim sq1
msg_per_page=10
Set rs=Server.CreateObject("ADODB.Recordset")
sq1="select * from note_comment order by id desc"
rs.pagesize=msg_per_page
rs.open sq1,conn,1,3
if rs.eof and rs.bof then
response.write"暂时没有留言"
end if
if not(rs.eof and rs.bof) then
totalrec=RS.RecordCount
if rs.recordcount mod msg_per_page=0 then
n=rs.recordcount\msg_per_page
else
n=rs.recordcount\msg_per_page+1
end if
currentpage=request("page")
If currentpage<>"" then
currentpage=cint(currentpage)
if currentpage<1 then
currentpage=1
end if
if err.number<>0 then
err.clear
currentpage=1
end if else
上一页 [1] [2] [3] [4] [5] [6] 下一页