日期:2014-05-17  浏览次数:20901 次

新手问下如何修改以下分页程序,过滤非法字符呢?
<%
page=cint(request( "page "))

Set   rs=Server.CreateObject( "ADODB.RecordSet ")  
sql= "select   *   from   company   order   by   compno "  
rs.Open   sql,conndb,1,1  
if   rs.eof   and   rs.bof   then
        response.Write( "没有记录 ")
else
rs.PageSize=15
if   page=0   then   page=1  
      pages=rs.pagecount
if   page   >   pages   then   page=pages
rs.AbsolutePage=page  

for   n=1   to   rs.PageSize  
%>
    <tr   height= "40 "   align= "center "   bgcolor= "#FFFFFF "   onMouseOver= "this.bgColor= '#cccccc '; "   onMouseOut= "this.bgColor= '#FFFFFF '; ">
        <td   > <%=rs( "compno ")%> </td>
        <td   > <%=rs( "compname ")%> </td>
        <td   > <%=rs( "province ")%> </td>
        <td   > <%=rs( "city ")%> </td>
        <td   > <%=rs( "phone ")%> </td>
        <td   > <%=rs( "fax ")%> </td>
<td   > <%=rs( "address ")%> </td>
<td   > <%=rs( "manager ")%> </td>
        <td   width= "36 "   > <a   href= "companymod.asp?compno= <%=rs( "compno ")%> "> <font   color=red> 修改 </font> </a> </td>
<td   width= "28 "   > <a   href= "javascript:deleteMe( ' <%=rs( "compno ")%> ') "> <font   color=red> 删除 </font> </a> </td>
    </tr>

<%
rs.movenext
if   rs.eof   then   exit   for
next
%>
</table>

<table   width= "774 "   border= "0 "   align= "center "   cellpadding= "0 "   cellspacing= "0 ">
    <tr>
        <td> &nbsp; </td>
    </tr>
    <tr   bgcolor= "#FFFFFF ">  
<form   method=Post   action= "course.asp ">    
            <td   height= "30 "   align= "right ">  
        <%if   Page <2   then            
        response.write   "首&nbsp;&nbsp;页|   上一页&nbsp; "
    else
        response.write   " <a   href=company.asp?page=1> 首&nbsp;&nbsp;页 </a> "
        response.write   "| <a   href=company.asp?page= "   &   Page-1   &   "> 上一页 </a> &nbsp; "
    end   if
    if   rs.pagecount-page <1   then
    &nbs