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

📄 indexlogin.asp

📁 这是一个用ASP写的在线考试系统.特别一点 就是考试试卷有两种考法,一种为系统自动出卷,另一种是老师出卷考试.前者的实现是参考网上代码.总的来说还是很值得参考的.
💻 ASP
字号:
<!--#include file="conn2.asp"-->
<script language=javascript>
function check()
{if (document.form1.stu_num.value=="")
{alert("请输入用户名");
document.form1.stu_num.focus();
return false;}
if (document.form1.stu_pwd.value=="")
{alert("请输入用户密码");
document.form1.stu_pwd.focus();
return false;}
document.form1.ctype.value="add";
document.form1.submit();
}
</script>
<%
session.timeout=125
if trim(request("ctype"))="add" then
'session("id")

stu_num=trim(request("stu_num"))
stu_pwd=trim(request("stu_pwd"))

setsql="select * from stuinit where stu_num='"&stu_num&"' and stu_pwd='"&stu_pwd&"'"
set rs=conn.execute(setsql)
'set rs=server.createobject("adodb.recordset")
'rs.open setsql,conn,3,2

if rs.eof then 
%>
<script language=javascript>
alert("用户名或密码错!请重试!");
</script>
<%
response.Redirect("loginwrong.asp")
'response.End()
else
response.Cookies("stu_name")=rs("stu_name")
'session("classes")=rs("班号")
'session("id")=rs("id")
response.Cookies("stu_num")=rs("stu_num")
response.Cookies("stu_pwd")=rs("stu_pwd")
'session("timen")=now
response.Redirect("default.asp")
%>

<%end if 
end if %>
<HTML><head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<title>在线考试系统</title>
<base target="_top">
<link href="Style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
	font-size: 14pt;
	font-weight: bold;
}
-->
</style>
<%    
 '   Response.Cookies("stu_num")=""
 '   Response.Cookies("stu_name")=""
 '   Response.Cookies("stu_pwd")=""    
   ' Response.Cookies("tested")=""
%>
</head>

<META content="MSH>
<BODY oncontextmenu="return false" text=#000000 vLink=#ffffff aLink=#ffffff 
link=#ffffff bgColor=#ffffff leftMargin=0 topMargin=0>
<DIV style="WIDTH: 754px; HEIGHT: 505px" align=center>
<TABLE height=80 cellSpacing=0 cellPadding=0 width=750 bgColor=#336799 
  border=0><TBODY>
  <TR>
    <TD bgColor=#336799 height=70>
      <TABLE height=65 cellSpacing=0 cellPadding=0 width="98%" border=0>
        <TBODY>
        <TR>
          <TD width="41%" height=59><img src="../images/xgfksxt.gif" width="280" height="60"></TD>
          <TD align=right width="58%" height=59><img src="../images/ksdh.gif" width="565" height="60"></TD>
          <TD width="1%" height=59></TD></TR></TBODY></TABLE></TD></TR>
  <TR>
    <TD bgColor=#ffffff height=2>
      <TABLE height=27 cellSpacing=0 cellPadding=0 width=755 border=0>
        <TBODY>
        <TR>
          <TD width=1 bgColor=#ffffff height=27>
          <TD class=dht width=354 height=19>
            <SCRIPT language=JavaScript class=class>
					<!--
						today = new Date();
						var hours = today.getHours();
						var minutes = today.getMinutes();
						var seconds = today.getSeconds();
						var timeValue = "<FONT COLOR=#000000>" + ((hours >12) ? hours -12 :hours); 
						timeValue += ((minutes < 10) ? "<FONT COLOR=#000000>:</FONT></BLINK>0" : "<FONT COLOR=#000000>:</FONT></BLINK>") + minutes+"</FONT></FONT>";
						timeValue += (hours >= 12) ? "<FONT COLOR=RED> PM</FONT>" : "<FONT COLOR=RED> AM</FONT>";
						function initArray()
						{
							this.length=initArray.arguments.length
							for(var i=0;i<this.length;i++)
							this[i+1]=initArray.arguments[i] 
						}
                                                                                                            var d=new initArray("<font color=RED>星期天","<font color=#000000>星期一","<font color=#000000>星期二","<font color=#000000>星期三","<font color=#000000>星期四","<font color=#000000>星期五","<font color=GREEN>星期六"); 
						document.write("<font color=#000000>",today.getYear(),"年","",today.getMonth()+1,"月","",today.getDate(),"日 </FONT>",d[today.getDay()+1]," ",timeValue); 
					//-->
		
</SCRIPT>          </TD>
          <TD width=22 height=27></TD>
          <TD align=middle width=206 height=27><img src="../images/news.jpg" width="120" height="20"></TD>
          <TD width=163 height=27></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE height=431 cellSpacing=0 cellPadding=0 width=757 bgColor=#689acc 
border=0>
  <TBODY>
  <TR>
    <TD vAlign=top width=201 bgColor=#88b3e1 height=431>
      <TABLE height=539 cellSpacing=0 cellPadding=0 width="100%" bgColor=#689acc 
      border=0>
        <form name="form1" method="POST" action="">     
		  <input type="hidden" name="ctype" > 
        <TR>
          <TD bgColor=#ffffff height=22>&nbsp;
          </TD>
        </TR>
        <TR>
          <TD vAlign=top  height=1><div align="center"><img src="../images/login.jpg" width="120" height="30"> </div></TD>
        </TR>
        <TR>
          <TD align=middle height=1>  </TD></TR>
        <TR>
          <TD height=38><img src="../images/BD14693_.gif" width="12" height="12"> 
            <FONT size=2>考生号:</FONT>
             &nbsp;&nbsp;<input type="text" name="stu_num" size="12" ></TD></TR>
        <TR>
          <TD height=65><img src="../images/BD14693_.gif" width="12" height="12"> 
            <FONT size=2> 密码: </FONT>
             &nbsp;&nbsp;<input type="password" name="stu_pwd" size="12" >         </TD></TR>
        <TR>
          <TD align=middle height=30><div align="center">
              </div></TD>
        </TR>
        <TR>
          <TD align=middle height=47><div align="center">
  <INPUT name=submit type=submit  title=仔细阅读考试流程和须知了吗? onclick="check()"  value=登录>
&nbsp;&nbsp;
<input type=reset value=重写 name=Submit2>
</div></TD>
        </TR>
        </FORM>
        <TR>
          <TD align=middle height=17>
            <HR color=#88b3e1 SIZE=1>
          </TD></TR>
        <TR>
          <TD align=middle height=31>  
            <div align="center"><a href="../default.asp">管理员登陆</a></div></TD>
        </TR>
        <TR>
          <TD align=middle height=6>  </TD></TR>
        <TR>
          <TD align=middle width=141 height=25>&nbsp;         </TD>
        </TR>
        <TR>
          <TD vAlign=top align=middle height=127><div align="center">
            <p><BR>
                <span class="style2">欢迎进入</span></p>
            <p class="style2"><BR>
                  在线考试系统 
            </p>
          </div>
            <P><FONT color=#ff0000 
            size=2><BR>
            </FONT></P>
            </TD></TR>
        <TR>
        <TD vAlign=top align=middle height=62>  </TD></TR></TBODY></TABLE></TD>
    <TD vAlign=top width=552 height=431>
      <TABLE width=734 align=center border=0>
        <TBODY>
        
        <TR>
          <TD width=728 height=40>·<A 
            href="&#32771;&#35797;&#20869;&#23481;.html?type=news&id=620">2005年9月10日中级计算机操作员考试时间通知</A><FONT 
            color=#ffff00>[2005-9-9]</FONT></TD>
        </TR>
        <TR>
          <TD width=728 height=31>·<A 
            href="&#32771;&#35797;&#20869;&#23481;.html?type=news&id=619">2005年9月10日高级计算机操作员考试时间通知</A><FONT 
            color=#ffff00>[2005-9-9]</FONT></TD>
        </TR>
        <TR>
          <TD width=728 height=31>·<A 
            href="&#32771;&#35797;&#20869;&#23481;.html?type=news&id=618">2005年9月10日中级计算机维修员考试时间通知</A><FONT 
            color=#ffff00>[2005-9-9]</FONT></TD>
        </TR>
        <TR>
          <TD width=728 height=31>·<A 
            href="&#32771;&#35797;&#20869;&#23481;.html">2005年9月10日高级计算机维修员考试时间通知</A><FONT 
            color=#ffff00>[2005-9-9]</FONT></TD>
        </TR>
        <TR>
          <TD width=728 height=33>·<A 
            href="Cookie&#35774;&#32622;.htm">Cookie的设置方法</A><FONT 
            color=#ffff00>[2003-8-19]</FONT></TD>
        </TR>
        <TR>
          <TD width=728 height=30>·<A 
            href="&#32771;&#35797;&#27969;&#31243;.htm">考 
            试 流 程</A><FONT color=#ffff00>[2003-4-11]</FONT></TD>
        </TR>
        <TR>
          <TD width=728 height=28>·<A 
            href="&#32771;&#35797;&#39035;&#30693;.html">考 
            试 须 知</A><FONT color=#ffff00>[2003-4-11]</FONT></TD>
        </TR> <TR>
          <TD align=middle height=65>
            <HR color=#88b3e1 SIZE=1>          </TD></TR>
          
          <TD align=middle width=728 height=53><img src="../images/news1.jpg" width="178" height="41"></TD>
          <TR>
          <TD width=728 height=25>·<A 
            href="&#19987;&#35775;&#25945;&#32946;&#37096;&#21103;&#37096;&#38271;&#24352;&#20445;&#24198;&#20026;&#20309;&#23398;&#26657;&#23398;&#36153;&#39640;&#23621;&#19981;&#19979;.htm">专访教育部副部长张保庆为何学校学费高居不下</A><FONT 
            color=#ffff00>[2005-9-12]</FONT></TD>
          </TR>
          <TR>
          <TD width=728 height=25>·<A 
            href="&#20013;&#22269;&#22269;&#23478;&#20027;&#24109;&#32993;&#38182;&#28059;&#25269;&#36798;&#22696;&#35199;&#21733;&#22478;&#24320;&#22987;&#22269;&#20107;&#35775;&#38382;.htm">中国国家主席胡锦涛抵达墨西哥城开始国事访问</A><FONT 
            color=#ffff00>[2005-9-12]</FONT></TD>
          </TR>
          <TR>
          <TD width=728 height=25>·<A 
            href="&#32993;&#38182;&#28059;&#20250;&#35265;&#22696;&#35199;&#21733;&#21326;&#20154;%20&#24378;&#35843;&#22788;&#29702;&#21488;&#28286;&#38382;&#39064;&#20915;&#24515;.htm">胡锦涛会见墨西哥华人 强调处理台湾问题决心</A><FONT 
            color=#ffff00>[2005-9-12]</FONT></TD>
          </TR>
          <TR>
          <TD width=728 height=25>·<A 
            href="&#32993;&#38182;&#28059;&#20250;&#35265;&#22696;&#35199;&#21733;&#21326;&#20154;%20&#24378;&#35843;&#22788;&#29702;&#21488;&#28286;&#38382;&#39064;&#20915;&#24515;.htm">中加决定把两国合作关系提升为“战略伙伴关系”</A><FONT 
            color=#ffff00>[2005-9-12]</FONT></TD>
          </TR>
</TBODY></TABLE></TD></TR></TBODY></TABLE>
    
<P>
<DIV align=center></DIV>
<P></P></DIV>

</BODY>
</HTML><br><br><br><br><br><br><!--#include file="footbar.htm"-->

⌨️ 快捷键说明

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