<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<link href="../css.css" rel="stylesheet" type="text/css" />
</head>
<%
adminusername=request.Form("adminusername")
adminpwd=request.Form("adminpwd")
if not(adminusername="" and adminpwd="") then
set rs=server.CreateObject("adodb.recordset")
rs.activeconnection=conn
rs.cursortype=3
sql="select * from admin where adminusername='"+adminusername+"' and adminpwd='"+adminpwd+"'"
sqlupdate="update admin set lastlogintime=nowlogintime,nowlogintime='"+cstr(now())+"' where adminusername='"+adminusername+"' and adminpwd='"+adminpwd+"'"
rs.open sql
if not rs.eof then
conn.execute sqlupdate
session("username")=adminusername
response.Redirect("framefile.html")
end if
end if
%>
<body>
<script language="javascript">
function checkfield()
{
if(window.formlogin.adminusername.value=="")
{
alert("用户名不能为空!");
window.formlogin.adminusername.focus();
return false;
}
if(window.formlogin.adminpwd.value=="")
{
alert("密码不能为空!");
window.formlogin.adminpwd.focus();
return false;
}
return true;
}
</script>
<form id="form1" name="formlogin" method="post" action="" onsubmit="return checkfield()">
  <p>&nbsp;</p>
  <div  align="center" class="login">
  <table width="30%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td colspan="2"><div align="left"></div></td>
    </tr>
	<tr>
      <td width="38%"><div align="right">用户名:</div></td>
      <td width="62%"><input name="adminusername" type="text" id="adminusername" class="text" /></td>
    </tr>
    <tr>
      <td><div align="right">密　码:</div></td>
      <td><input name="adminpwd" type="password" id="adminpwd" class="text" /></td>
    </tr>
    <tr>
      <td colspan="2"><div align="center">
        <input type="submit" name="Submit" value="提交" />
        <input type="reset" name="Submit2" value="重置" />
      </div></td>
    </tr>
  </table>
  </div>
  <p>&nbsp;</p>
</form>
</body>
</html>
<%
set rs=nothing
conn.close()
%>
