gusucode.com > ASP+ACCESS在线考试系统设计(源代码+论文) > ASP+ACCESS在线考试系统设计(源代码+论文)\郭晓璇论文第二稿\Login.asp

    <%@ Language=VBScript %>
<%
'response.write "OK!"
name=trim(request("name"))
passwd=trim(request("passwd"))
if name<>"" and passwd<>"" then
	response.write "OK!"
	Set conn = Server.CreateObject("ADODB.Connection")
	conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("试题库.mdb")
	set rs= server.createobject("adodb.recordset") 
	'判断是否为用户
	sql= "select * from 用户记录 where 用户名='"& name &"' and 密码='"& passwd &"'"
	Set rs= conn.Execute(sql) 
	if not rs.eof then
		session("pass")=1
		session("user")=name
		session("mima")=passwd
		conn.close
		response.redirect "mainselect.asp"
	else
		Response.Write "非法用户!"
	end if 
else 
end if
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>.: 请登陆网络考场 :.</title>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta NAME="GENERATOR" Content="Microsoft FrontPage 4.0">
</head>
<body bgcolor="#C0C0C0">
<form action="login.asp" id="FORM1" method="post" name="FORM1">
  <p title> </p>
  <table border="0" width="100%">
    <tr>
      <th width="100%"><table border="0" width="100%">
        <tr>
          <th width="100%"><img src="Images/back.gif" alt="背景.gif (87350 bytes)" width="480" height="96"></th>
        </tr>
      </table>
      </th>
    </tr>
  </table>
  <div align="center"><center><p title>Username:<input id="text2" name="name"
  style="border:1px solid #C0C0C0; HEIGHT: 22px; WIDTH: 103px; padding-left:0; padding-right:0; padding-top:1; padding-bottom:1" size="20"><br>
    Password:<input id="password2"
  name="passwd" style="border:1px solid #C0C0C0; HEIGHT: 23px; WIDTH: 101px; padding-left:0; padding-right:0; padding-top:1; padding-bottom:1" type="password" size="20"></p>
  </center></div><table border="0" width="100%">
    <tr>
      <td width="100%"></td>
    </tr>
  </table>
  <div align="center"><center><p title><input id="submit1" name="submit1" type="submit"
  style="font-size: large; font-style: normal; font-variant: normal; font-weight: bold; background-image: url('Images/enter3.bmp'); background-repeat: no-repeat; background-attachment: scroll; background-position: center 50%"
  title value="     "></p>
  </center></div>
</form>
</body>
</html>