问题 问答题


认真阅读以下关于静态网页制作和动态网页编程的技术说明,根据要求回答问题1~问题6。
【说明】
一、静态网页制作
某电子商务公司用ASP实现了一个用于手机销售信息查询的网页,主页文件名为“index.html”,其文档内容如下。
[index.html文档内容]
<html>
<head>
<title>易搜手机资讯广场</title>
</head>
<frameset cols="198, *" "border=0">
<frame name="side" src="side.html" scrolling="No">
<frameset rows=’96, *" "border=0">
<frame name="top" src="top.html" scrolling="No">
<frame name="main" src="main.asp" scrolling="Auto">
</frameset>
</frameset>
<body>
</body>
</html>
二、动态网页编程
图6-9是用户按品牌型号进行查询时的网页(main.asp)在IE浏览器上运行后的效果图。表6-9是手机信息数据库表结构。


表6-9 数据库字段说明表

字段名类型备注  字段名类型备注
Id自动编号记录编号Price货币参考价格
Brand文本手机品牌Function文本功能描述
Type文本手机型号
其中,Brand字段下共有两种数据:moto、nokia,分别代表摩托罗拉、诺基亚。
【main.asp文档的内容】
<html>
<head>
<title>易搜手机资讯广场</title>
</head>
<body bgcolor="#ffffff" background="bg1.gif" text="#000000">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<left>
<!-以下为实现按手机型号搜索功能的部分-->
<from name="form1" method="post" action="main_search.asp">
<div align="left">
<table width="400" border="0">
<tr>
<td align="right" width="120">请输入<font color="ff0000">型号</font>关键字:</td>
<td align="left" width="40">
<input name="Searchtxt" type="text" id="Searchtxt"></td>
<td colspan="2" align="left">
<input type="submit" name="Submit" value="搜索"></td>
</tr>
</table>
</div>
</form>
</left>
</table>
<!-以下为浏览手机信息部分功能>
<table>
<center>
<%dim searchtext searchtext=Request.Form ("Mobel")
exec="select * from mod order by Type ASC"
set conn=server.createobject ("adodb.connection")
dbpath=server.mappath ("mod.mdb")
conn.open "PROVIDER=Microsoft.jet.OLEDB.4.0;data source="&dbpath
set rs=server.createobject ("adodb.recordset")
rs.open exec, conn, 1, 3
<!-省略关于分页功能的代码>
%>
<div align="right">
<table border="1" width="100%">
<tr>
<th width="20%"><font color="#996633" size="2">品牌</font></th>
<th width="20%"><font color="#996633" size="2">型号</font></th>
<th width="20%"><font color="#996633" size="2">参考价格</fonr></th>
<th width="40%"><font color="#996633" size="2">功能描述</font></th>
</tr>
</table><br>
<% do while NOT rs.EOF and rowcount>0%>
<div align="right">
<table border="1" width="100%">
<tr>
<td align="center" width="20%"><font size="2"><%=rs (Brand) %></font></td>
<td align="center" width="20%"><a herf="<%=rs ("type") %>.asp"><font size="2"><%=rs ("Type") %></font></a></td>
<td align="center" width="20%"><font size="2"><%=rs (Price) %></font></td>
<td align="center" width="40%"><font size="2"><%=rs (Function) %></font></td>
</tr>
</table>
</div>
<%rowcount=rowcount-1%>
<%rs.MoveNext’ 指向下一条%>
<%LOOP%>
<br>
<!--省略关于分页功能的代码>
</div></center></td></tr>
</table>
</body>
</html>

【问题2】 在IE显示的网页上,当用户单击【搜索】按钮后,将会以 (1) 方式将用户输入的查询数据提交给服务器,并且触发 (2) 程序的执行,从而完成用户对手机类型的搜索请求。 (1) A.get B.post C.pull (2)

A.main.asp
B.main_search.asp
C.index.asp

答案

参考答案:

解析:(1) B,或post (2) B,或main_search.asp这是一道要求读者掌握网页中输入数据的提交方式和过程的分析理解题。本题的解答思路如下。 网页控件中的数据提交方式及后续处理是由该控件所在的表单form来定义的。<form>标志具有name、 action、method等属性。其中,action属性指明处理程序的程序名;method属性用来定义处理程序从表单中获得信息的方式,可取值为get或post。get方式是处理程序从当前网页文档中获取数据,这种获取方式传送的数据量是有所限制的,通常限制在1KB以下;post方式与get方式相反,它是当前网页文档把数据传送给处理程序,传送的数据量要比使用get方式大得多。 本试题中与“搜索”按钮相关的编码是在main.asp文档中定义,其相关代码如下: <from name="forml" method="post" action="main_search.asp"> <input type="submit" name="Submit" value="搜索"></td> 从表单forml的定义可知,当用户单击“搜索”按钮后,该控件的查询数据将以post方式提交给服务器,并且触发main_search.asp程序的执行,从而完成用户对手机类型的搜索请求。

填空题
多项选择题