ASP留言本几个BUG
小生,今天下了个随缘网络留言本 V1.0(免费版),测试当中发现几个问题,请高手帮忙解决
源代码如下:
<!--#include file="conn.asp"-->
<!--#include file="ubb/ubb.asp"-->
<%Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from pz where id=1"
rs.open sql,conn,1,1
htsh=rs("sh")
%>
<SCRIPT>
function view1(url){
var url; window.open(url,'_blank','status=no,scrollbars=yes,top=20,left=110,width=600,height=460');
}
</SCRIPT>
<%
'#################################################################
'# 程序名称:随缘网络留言本 V1.0
'# 授权方式:免费软件
'# 作者:随缘网络 QQ:84723090
'# 演示及技术支持:http://www.115cn.cn/book
'# 发布时间:2007-8-8
'# 声明:本程序由随缘网络独立自主开发,保留所有版权。
'# 各种用途均可免费使用、自由传播,但必须保留程序代码中的版权信息。
'#################################################################
%>
<% Set rs2=Server.CreateObject("ADODB.RecordSet")
sql2="select top 1 * from book where sh=1 and gg=1"
rs2.Open sql2,conn,1,1
%>
<html>
<head>
<meta name="keywords" content="随缘网络,免费留言本,审核功能.留言板">
<meta name="description" content="随缘网络带审核置顶功能留言簿V1.0,打造完美免费的留言本,将免费留言板坚持到底!">
<LINK href="css.css" type=text/css rel=stylesheet>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>随缘网络带审核置顶功能留言簿V1.0--首页</title>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
</head>
<body topmargin="0" style="background-image: url('bgmain.gif'); background-position-x: center; text-align:right" >
<%
key=request("key")
fl=request("fl")
%>
<div align="center">
<table width="760" border="1" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" height="163" style="border-collapse: collapse" bordercolor="#99CCFF">
<tr>
<td width="760" height="163" align="center">
<img border="0" src="logo.jpg" width="758" height="159"></td>
</tr>
</table>
</div>
<div align="center">
<table width="760" border="0" cellpadding="0" bgcolor="#FFFFFF" height="61" style="border-collapse: collapse" bordercolor="#3399FF" id="table9">
<tr>
<td width="764" height="32" align="center" bgcolor="#99CCFF" colspan="2">
<b>
<a href="add.asp"><font color="#000000">签写留言</font></a>
<a href="index.asp"><font color="#000000">浏览留言</font></a></b></td>
</tr>
<tr>
<td width="43" height="29" align="center">
<p align="left"><font color="#FF0000"><b>公告:</b></font></td>
<td width="717" height="29" align="center">
<marquee onMouseOver="this.stop();" onMouseOut="this.start();" scrollamount="7" scrolldelay="180"><%if rs2.eof and rs2.bof then%>暂无公告
<%else%><a href="javascript:view1('gg.asp?id=<%=rs2("id")%>')"><%=rs2("bt")%></a><%end if%></marquee></td>
</tr>
</table>
<%
page=clng(request("page"))
Set rs=Server.CreateObject("ADODB.RecordSet")
if htsh=0 then
if key="" and fl="" then
sql="select * from book where sh=1 order by gg desc, top desc,sj desc"
else
if fl=1 then
sql="select * from book where bt Like '%"& key &"%'and sh=1 order by gg desc, top desc,sj desc"
else
sql="select * from book where nr Like '%"& key &"%'and sh=1 order by gg desc, top desc,sj desc"
end if
end if
else
if key="" and fl="" then
sql="select * from book order by gg desc, top desc,sj desc"
else
if fl=1 then
sql="select * from book where bt Like '%"& key &"%'order by gg desc, top desc,sj desc"
else
sql="select * from book where nr Like '%"& key &"%' order by gg desc, top desc,sj desc"
end if
end if
end if
rs.Open sql,conn,1,1
i=1
if rs.eof and rs.bof then
response.Write("没有留言")
else
rs.PageSize=5
if page=0 then page=1
pages=rs.pagecount
if page > pages then page=pages
rs.AbsolutePage=page
for j=1 to rs.PageSize
%>
<table width="760" style="border-collapse:collapse" border="1" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF" height="166" style="border-collapse: collapse" bordercolor="#99CCFF" id="table5">
<tr>
<td height="27" align="center" bgcolor="#99CCFF">
<font color="#000000">
<a href="mailto:<%=rs("email")%>">
<img border="0" src="mail.gif" width="16" height="16"></a>
<a target="_blank" href="http://wpa.qq.com/msgrd?V=1&Uin=<%=rs("qq")%>&Site=厦门随缘网络科技留言本&Menu=yes">
<img border="0" src="qq.gif" width="16" height="16"></a>
<a target="_blank" href="<%=rs("web")%>">
<img border="0" src="home.gif" width="16" height="16"></a></font></td>
<td height="27" align="center" bgcolor="#99CCFF">
<p align="left"> <% if rs("top")=1 then %><b><font color="#FF0000">置顶</font></b> <%end if%><% if rs("gg")=1 then %><b><font color="#FF0000">公告:</font></b><%else%><b>主题:</b><%end if%><%=rs("bt")%>
发表于:<%=rs("sj")%></td>
</tr>
<tr>
<td width="25%" height="140" align="center" valign="top" rowspan="2" bordercolor="#99CCFF">
<table border="0" width="92%" cellspacing="0" cellpadding="0" id="table6">
<tr>
<td height="110">
<p align="center"><img src="<%=rs("tx")%>" ></td>
</tr>
<tr>
<td height="24" align="center"><%=rs("user")%></td>
</tr>
</table></td>
<td width="570" align="center" valign="top">
<table style="table-layout: fixed;WORD-BREAK: break-all; WORD-WRAP: break-word" border="0" width="561" cellspacing="0" cellpadding="0" id="table7" height="67">
<tr>
<td width="1%">
<p align="left" style="line-height: 150%"></td>
<td width="556">
<%=Ubbcode(server.htmlencode(rs("nr")))%>
</td>
</tr>
</table>
</a></td>
</tr>
<tr>
<td width="570" align="center" height="25">
<p align="left"><%if rs("hf")="" then%><span style="font-size: 9pt"><b> <font color="#006699">管理员回复:</font></b><font color="#006699">暂未回复!</font><%else%><b>
<font color="#006699">管理员回复:</font></b><font color="#006699"><%=rs("hf")%></font><%end if%></span></td>
</tr>
</table>
<TABLE cellSpacing=0 cellPadding=0 width=760 border=0 id="table13" bgcolor="#FFFFFF">
<TBODY>
<TR>
<TD height=6></TD></TR></TBODY></TABLE><%
i=i+1
rs.movenext
if rs.eof then exit for
next
%>
<table width="760" cellpadding="0" border="0" cellspacing="0" height="35" bgcolor="#99CCFF">
<tr bgcolor="#FFFFFF">
<td align="left" width="63%" bgcolor="#99CCFF"> <%if Page<2 then
response.write "首页 上一页 "
else
response.write "<a href=index.asp?key="&key&"&fl="&fl&"&page=1>首页</a> "
response.write "<a href=index.asp?key="&key&"&fl="&fl&"&page=" & Page-1 & ">上一页</a> "
end if
if rs.pagecount-page<1 then
response.write "下一页 尾页"
else
response.write "<a href=index.asp?key="&key&"&fl="&fl&"&page=" & (page+1) & ">"
response.write "下一页</a> <a href=index.asp?key="&key&"&fl="&fl&"&page="&rs.pagecount&">尾页</a>"
end if
response.write " 页次:<strong><font color=red>"&Page&"</font>/"&rs.pagecount&"</strong>页 "
response.write " 共<b><font color='#FF0000'>"&rs.recordcount&"</font></b>条记录 <b>"&rs.pagesize&"</b>条记录/页" %>
转到第
<select name="page" onChange="javascript:location=this.options[this.selectedIndex].value;">
<%
for d = 1 to Rs.PageCount
if d = page then%>
<option value="index.asp?key=<%=key%>&fl=<%=fl%>&page=<%=d%>" selected><%=d%></option>
<%else%>
<option value="index.asp?key=<%=key%>&fl=<%=fl%>&page=<%=d%>"><%=d%></option>
<%
end if
next
%>
</select> 页
</td>
<%
end if
rs.close
set rs=nothing
%>