posts - 48,comments - 29,trackbacks - 0

<%@ language=VBScript %>
<!--#include file="conn.asp"-->
<html>
<head>
<!--#include file="include/title.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.9p {  font-family: "宋体"; font-size: 9pt; line-height: 18px}
.style1 {color: #FF0000}
-->
</style>

</head>
<body background="mainbg.gif"  text="#000000" topmargin="0">
 
 
     <script type="text/javascript" Language="JavaScript">
 
  var time=document.form1.nowTime.value;
 function showTime(){
  if(time>=0){
   document.form1.nowTime.value=time--;
   timerID=setTimeout("showTime()",1000);
  } else {
   document.form1.submit.disabled=false;
   clearTimeout(timerID);
  }
 }

 function form_check(){
    var frm=document.form1;

    frm.action="";
    frm.submit;
   return true;
}


 function setOther()
 {
 var frm=document.form1;
   alert(frm.elements["other"].readonly);
  if (frm.elements["other"].readonly=="true")
   frm.elements["other"].readonly="false"
 else
  {
    frm.elements["other"].text="";
    frm.elements["other"].readonly="true";
   }
   return true;
 }
</script>

<div align="center"  >
 <!--#include file="include/top.asp"-->
    <%
set rec=server.CreateObject("adodb.recordset")
sqlstr="select * from class where kg=0  order by id"
rec.open sqlstr,conn,1,1
rec.pageSize=20
if request("page")="" then
 rec.absolutePage=1
 else
 rec.AbsolutePage=request("page")
 end if
 for i=1 to rec.PageSize
  if rec.EOF then
  exit for
  end if
  %>


 <form name="form1" method="post" action="" >
  <table width="760" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
   <tr>
    <td>
    <table width="760" border="0" cellspacing="0" cellpadding="0" bgcolor="#0fcfff">
    <tr>
     <td align="left"><%=rec("title")%> ( ) </td>
      

    </tr>
 <%
set recontent=server.CreateObject("adodb.recordset")
sql="select * from vote where class="&rec("id") &"  order by id"
recontent.open sql,conn,3,1
 %>
  
 <%recontent.movefirst
 do while not recontent.eof%>
   <tr align="left">
     <td height="23" width="600" bgcolor="#E7E7E7">
      &nbsp&nbsp&nbsp
     <input type=<%=rec("style")%> name=<%=rec("id")%> value=<%=recontent("id")%>  >
       <%=recontent("vote")%>
      
       </td>
    </tr>
 <%recontent.movenext
 loop%>
 
</table>
</td>
    </tr>
       <%
      rec.movenext
     next
   %>
  <%
    rec.close
    set rec=nothing
  %>   
             <tr align="center" >
              <td  height="1"  width="601">
               <input type="submit" value=" 提 交 "   name=Submit onClick="return form_check();" style="height:20px;font-size:9pt;border-width:1px">
             </td>
         </tr>

  </table>
</form>

    <!--#include file="include/bottom.asp"-->
</div>
</body>
</html>


 

posted on 2007-03-18 23:51 风筝 阅读(603) 评论(2)  编辑 收藏 引用 所属分类: asp文章

FeedBack:
# re: asp中有关循环的使用
2007-03-26 12:28 | firefox
没有分析啊  回复  更多评论
  
# re: asp中有关循环的使用
2007-03-27 12:06 | 风筝
哦,上面写的是一个asp页面,两层循环用来显示统计的内容
  回复  更多评论
  
只有注册用户登录后才能发表评论。