刷题刷出新高度,偷偷领先!偷偷领先!偷偷领先! 关注我们,悄悄成为最优秀的自己!

简答题

阅读下列说明,回答问题1 和问题2,将解答填入答题纸的对应栏内。

【说明】

某公司用ASP+Access 数据库开发了学生管理系统,用户登录界面如图4-1 所示:

【问题1】(每空1 分,共11 分)

下面是该系统用户登录界面login.asp 的部分代码,其中验证码使用verycode.asp 文件生成。请根据题目说明,补充完成。

< html xmlns="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);

}

(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=30>< input type= (8) name=use_pwd> </td></tr>

<tr>

<td align=right>验证码:</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="登录">

></td>

…省略…

</body>

</html>

【问题2】(每空2 分,共4 分)

下面是登录系统中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&"" and

password=""&md5(password)&""

(12).open sql,conn,1,3

if rs.eof then

Response.write "<center>"&username&"用户名或密码错误,请重新输入!"

else

…省略…

session("user_name")=request("usre_name")

response. (13) "index.asp"

end if

…省略…

%>

使用微信搜索喵呜刷题,轻松应对考试!

答案:

[问题1](1)<head>(2)user_name(3)false(4)user_pwd(5)return

(6)post (7)text (8)password(9)4(10)verycode.Asp(11)submit

[问题2] (12)rs  (13)redirect

解析:

问题1:
(1)补充的是<head>标签,这是HTML文档头部信息的开始和结束标签。
(2)此处应填写用户名的输入框名称,与后面的代码中的theForm.user_name.focus()相对应。
(3)用户未输入密码时,提示用户输入并返回false,阻止表单提交。
(4)与第(2)空相同,此处应填写密码输入框的名称。
(5)最后返回true表示验证通过。
(6)表单提交的方式选择post,因为登录需要传输用户名和密码信息。
(7)用户名的输入框类型为text。
(8)密码输入框的类型为password。
(9)验证码的输入最大长度为4。
(10)点击刷新验证码时,需要重新加载verycode.asp生成新的验证码。
(11)登录按钮的类型为submit,用于提交表单。

创作类型:
原创

本文链接:阅读下列说明,回答问题1 和问题2,将解答填入答题纸的对应栏内。 【说明】 某公司用ASP+Acce

版权声明:本站点所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明文章出处。

让学习像火箭一样快速,微信扫码,获取考试解析、体验刷题服务,开启你的学习加速器!

分享考题
share