某公司用ASP+Access数据库开发了学生管理系统,用户登录界面如图4—1所示: (含图)
【问题1】下面是该系统用户登录界面login.asp的部分代码,其中验证码使用verycode.asp 文件生成。请根据题目说明,补充完成。
(5) true;
}
......//省略验证码检测部分代码
-->
</script>
</head>
<body>
<table cellSpacing=1 cellPadding=5 width=460 border=0>
<FORM action="check.asp? action=login"method=(6) on Submit="return chk(this)">
···省略···
<tr>
<td align=right width=60 height=30>用户名:</td>
<td height=30><input type= (7) name=user_name></td></tr>
<tr>
<td align=right height=30>密&nbsp;&nbsp;码:</td>
<td height=30x<input type= (8) name=use_pwd></td></tr>
<tr>
<td align=righ>t验证码:</td>
<td><input maxlength (9) name=veri_code<img src="vericode.asp" border='0'onClick="this.src='(10)""alt=点击刷新'/></td></tr>
<tr align=middle>
<td colSpan=2 height=40><input type=(11) value="登录">
<html xmins="http://www.w3.org/1999/xhtml>
(1)
<title学生信息管理系统</title>
<script language="JavaScript">
<!--
function chk(theForm)
{
if(theForm.(2)value="")
{
alert(“请输入用户名!”);
the Form.user_name.focus();
return((3));
}
if(theForm.(4).value==)
{
alert("请输入密码!");
theForm.user_pwd.focus();
return(false);
}
></td>
··省略···
</body>
</html>
【问题2】下面是登录系统中check.asp文件的部分代码,请根据login.asp 代码将其补充完整。<%username=trim(request("user_name"))password=trim(request("user_pwd"))set
rs=server.createobject("adodb.recordset")sql="select*from admin where username=""&username&”" andpassword=""&md5(password)&"" (12).open sql,conn,1,3if rs.eof thenResponse.write"<center>"&username&”用户名或密码错误,请重新输入!"else...省略...
session("user_name")=request("usre_name")response. (13)"index.asp"end if...省略...%>