⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.asp

📁 是个不错的文件代码,希望大家好好用,
💻 ASP
字号:
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<meta name="generator" content="microsoft frontpage 4.0">
<meta name="progid" content="frontpage.editor.document">
<title>玫瑰情缘——脑筋急转弯</title>
<style type="text/css">
<!-- 
td           { font-size: 12px; line-height: 17px }
body         { font-size: 12px; line-height: 17px }
p            { margin-top: 1px; margin-bottom: 1px }
a:link       { text-decoration: none; color: black }
a:visited    { text-decoration: none; color: black }
a:active     { text-decoration: none }
a:hover      { text-decoration: underline; color: red }
body,p,td    { font-family:verdana, arial, helvetica, sans-serif; }
-->
</style>
<script language="javascript" type="text/javascript">
<!--
function mm_popupmsg(msg) { //v1.0
  alert(msg);
}
//-->
</script>
</head>
<body background="images/bg3.gif">
<!--#include file="head.asp"--> 
<div align="center">
  <center>
  <table border="1" width="776" bordercolorlight="#3399ff" cellspacing="0" cellpadding="0" bordercolordark="#ffffff">
    <tr>
      <td width="70" height="25" bgcolor="#bbdbff" align="center"><img border="0" src="images/num.gif" width="46" height="23"></td>
      <td width="542" height="25" bgcolor="#bbdbff" align="center"><img border="0" src="images/question.gif"></td>
      <td width="102" height="25" bgcolor="#bbdbff" align="center"><img border="0" src="images/key.gif"></td>
    </tr>
<%              
sql="select * from data order by id desc"              
set rs=server.createobject("adodb.recordset")              
rs.open sql,connstr,1,1              
if rs.eof then              
response.write "<font color=#ff0000>暂时没有任何题目!</font>"                          
else              
const maxperpage=50              
dim currentpage              
rs.pagesize=maxperpage              
currentpage=request.querystring("pageid")              
if currentpage="" then              
currentpage=1              
elseif currentpage<1 then              
currentpage=1              
else              
currentpage=clng(currentpage)              
	if currentpage > rs.pagecount then              
	currentpage=rs.pagecount              
	end if              
end if              
              
if not isnumeric(currentpage) then              
currentpage=1              
end if              
dim totalput,n              
totalput=rs.recordcount              
if totalput mod maxperpage=0 then              
n=totalput\maxperpage              
else              
n=totalput\maxperpage+1              
end if              
if n=0 then              
n=1              
end if              
rs.move(currentpage-1)*maxperpage              
i=0     
w=1         
do while i< maxperpage and not rs.eof               
%>
    <tr>
      <td width="70" bgcolor="#ecf5ff">
        <p align="center"><font color="#800000"><%=w%></font></p>
      </td>
      <td width="542" bgcolor="#ecf5ff">&nbsp;<font color="#008080"><%=rs("question")%></font>    
      <%if session("admin")<>"" then%>                                                                             
    &nbsp;<a href="edit.asp?id=<%=rs("id")%>"><font color="#008000">编辑</font></a>&nbsp;<a href="del.asp?id=<%=rs("id")%>"><font color="red">删除</font></a>        
        <%end if%>        
      </td>     
      <td width="102" bgcolor="#ecf5ff">  
      <p align="center"> 
      <input onclick="mm_popupmsg('答案:<%=rs("key")%>')" type=button value=答案 name=button<%=rs("id")%> style="font-size: 12px"></p> 
      </td>    
    </tr>    
    <%                                                                                          
    i=i+1      
    w=w+1                                                                      
    rs.movenext                                                                             
    loop                                                                                                  
    end if        
    rs.close                                                   
    %>     
    <tr>    
      <td width="718" height="25" bgcolor="#bbdbff" colspan="3">    
      <p align="center">页数:<%=currentpage%>/<% =n%>                                                                      
   	<%k=currentpage                                                                                                 
   	if k<>1 then%>                                                                         
   	<a href="index.asp?pageid=1">首页</a>                                                                                                 
   	<a href="index.asp?pageid=<%=k-1%>">上一页</a>                                                                                                 
   	<%else%>                                                                             
   	首页&nbsp;上一页                                                                                                 
   	<%end if%>                                                                         
   	<%if k<>n then%>                                                                                                 
   	<a href="index.asp?pageid=<%=k+1%>">下一页</a>                                                                                                 
   	<a href="index.asp?pageid=<%=n%>">尾页</a>                                                                                                 
   	<%else%>                                                                             
   	下一页&nbsp;尾页                                                                                                 
   	<%end if%>                                                                         
        共有<%=totalput%>道题目</p>        
      </td>     
    </tr> 
    <tr> 
    <td colspan="3" width="718"> 
<p align="center" style="margin-top: 2; margin-bottom: 2">       
      <%        
      p=1       
      for j=1 to n step 1       
      if k=p then       
      response.write "<font color=red style=font-size:12px>"&p&"</font>&nbsp;&nbsp;"       
      else       
      response.write "<font style=font-size:12px><a href=index.asp?pageid="&p&">"&p&"</a></font>&nbsp;&nbsp;"    
      if j mod 25=0 then   
      response.write "<p align=center style=margin-top: 2; margin-bottom: 2>"   
      end if      
      end if       
      p=p+1        
      next        
      %>
    </td>
    </tr>    
  </table>    
  </center>    
</div>                                                                  
<!--#include file="foot.asp"-->                                                                   
</body>                                                                          
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -