阅读并分析
1、
<html>
<head>
<title> Request的Form方法用法示例</title>
</head>
<body>
<h2 align="center">请填写个人信息</h2>
<form action="4-2.asp" method="post" name="form1">
姓名:<input type="text" name="user_name" ><br>
密码:<input type="password" name="password"
><br>
性别:<input type="radio" name="sex" value="男">男
<input type="radio" name="sex" value="女">女<br>
爱好:<input type="checkbox" name="love" value="音乐">音乐
<input type="checkbox" name="love" value="计算机">计算机<br>
职业:<select name="career">
<option value="教育业">教育业</option>
<option value="金融业">金融业</option>
<option value="其它">其它</option>
</select><br>
简述:<textarea name="introduction" rows="2"
cols="40" wrasp="soft">
</textarea><br>
<input type="submit" value=" 确 定 " size="20">
<input type="reset" value="重新填写" size="20">
</form>
</body>
</html>
2、
<% Option Explicit %>
<html>
<head>
<title> Request的Form方法用法示例</title>
</head>
<body>
<h2 align=center>下面是您的个人信息</h2>
<%
Dim user_name,password,sex,love,career,introduction '为了引用方便,定义变量
user_name=Request.Form("user_name")
'前面的user_name是一个变量,后面的'user_name是表单中一个元素的名字,不是一
'回事,名字可以一样,也可以不一样,这里主要是为了记忆。下面的也一样
password=Request.Form("password")
sex=Request.Form("sex")
love=Request.Form("love")
career=Request.Form("career")
introduction=Request.Form("introduction")
%>
姓名:<%=user_name%><br>
密码:<%=password%><br>
性别:<%=sex%><br>
爱好:<%=love%><br>
职业:<%=career%><br>
简介:<%=introduction%>
</body>
</html>
3、
<% Option Explicit %>
<html>
<head>
<title> Request的Form方法用法示例</title>
</head>
<body>
<h2 align="center">请填写个人信息</h2>
<form action="" method="post" name="form1">
姓名:<input type="text" name="user_name" ><br>
密码:<input type="password" name="password"><br>
性别:<input type="radio" name="sex" value="男">男
<input type="radio" name="sex" value="女">女<br>
爱好:<input type="checkbox" name="love" value="音乐">音乐
<input type="checkbox" name="love" value="计算机">计算机<br>
职业:<select name="career">
<option value="教育业">教育业</option>
<option value="金融业">金融业</option>
<option value="其它">其它</option>
</select><br>
简述:<textarea name="introduction" rows="2"
cols="40" wrap="soft"></textarea>
<br>
<input type="submit" value=" 确 定 " size="20">
<input type="reset" value="重新填写" size="20">
</form>
<% If Request.Form("user_name")<>""
Then '这一句非常重要 %>
<h2 align=center>下面是您的个人信息</h2>
<%
Dim user_name,password,sex,love,career,introduction '定义变量
user_name=Request.Form("user_name")
password=Request.Form("password")
sex=Request.Form("sex")
love=Request.Form("love")
career=Request.Form("career")
introduction=Request.Form("introduction")
%>
姓名:<%=user_name%><br>
密码:<%=password%><br>
性别:<%=sex%><br>
爱好:<%=love%><br>
职业:<%=career%><br>
简介:<%=introduction%>
<% End If %>
</body>
</html>
4、
<html>
<head>
<title> QueryString用法示例</title>
</head>
<body>
<%
Dim name,age
name=Request.QueryString("name")
age=Request.QueryString("age")
%>
您好,您的姓名是<%=name%>,您的年龄是<%=age%>
</body>
</html>
请找出并分析其中使用的Request对象的FORM方法代码:
<!--#include file="conn_db.asp"-->
<!--#include file="../char.inc"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=gb2312">
<title>《WEB程序设计与应用》网络教学平台</title>
<link href="../mystyle.css" rel="stylesheet"
type="text/css">
<body background="../images/bg.gif" topmargin="0">
<table width="770" height="89" border="0"
align="center"
cellpadding="0" cellspacing="0" background="../images/top-bg.gif">
<tr>
<td width="150" height="90"><div align="right">
<img src="../images/logo.gif" width="120"></div></td>
<td width="300"><div align="right">
<img src="../images/top-2.gif" width="250"
height="70"></div></td>
<td width="403"><img src="../images/top-3.gif"
width="350" height="70"></td>
</tr>
</table>
<table width="770" border="0" align="center"
cellpadding="0" cellspacing="0">
<tr>
<td width="170" height="500" valign="top"
background="../images/bgindex.gif" bgcolor="#FFFFFF">
<table width="100%" border="0" align="center"
cellpadding="0" cellspacing="0">
<tr>
<td height="22" bgcolor="#0099CC"><div
align="center">
<a href="../index.asp">返回首页</a></div></td>
</tr>
<tr>
<td height="22" background="../images/07.gif">
<div align="left"><font color="#FF0000">
<img src="../images/tb.gif" width="21" height="14">
<strong><font color="#FFFFFF">教学内容</font></strong></font></div></td>
</tr>
<SCRIPT>numTotal=8;scores[1]='KB1';scores[2]='KB1';scores[3]='KB2';
scores[4]='KB3';scores[5]='KB4';scores[6]='KB5';scores[7]='KB6';scores[8]='KB7'</SCRIPT>
</TD>
</TR>
</TBODY>
</TABLE></td>
</tr>
<td width="10" height="6" background="../images/i-yinying.gif"> </td>
<td width="590" valign="top" bgcolor="#FFFFFF"><table
width="85%"
border="0" align="center" cellpadding="4"
cellspacing="0">
<tr>
<td> </td>
</tr>
<tr>
<td><img src="brief.gif" width="500"
height="30"></td>
</tr>
<tr>
<td> </td>
</tr>
<%
if not isempty(Request.Form("Review")) then
SqlReview="select * from advice where SenderName='" &
request("SenderName") _
& "' order by id asc"
set RSReviewadvice=db.Execute(SqlReview)
ReviewLabel=true
%>
<%end if%>
<%
if not isempty(Request.Form("OK")) and Trim(Request("adviceText"))<>""
then
CurrentTime = Now()
SqlString="Insert into advice (SenderName, " _
& "adviceText, WhenSent, Status) values (" _
& "'" & Request.Form("SenderName") &
"', " _
& "'" & htmlencode(Request.Form("adviceText"))
& "', " _
& "'" & CurrentTime & "', " _
& "'未处理')"
db.Execute(SqlString)
Response.Redirect "ok.htm"
end if
%>
<form method="POST" action="">
<tr>
<td> <table width="100%" align="center"
cellpadding="4" cellspacing="1"
id="table3" style="border-collapse: collapse">
<tr bgcolor="#0099CC">
<td height="25" colspan="2"><div align="center"><font
color="#FF0000">
<font color="#FFFFFF">欢迎同学们对我们的教学提出意见和建议,
我们将在5个工作日内给予回复</font></font></div></td>
</tr>
<tr>
<td width="79" height="25" rowspan="2"
bgcolor="#0099CC"> <div align="center">
<font color="#FFFFFF">用户名</font></div></td>
<td bgcolor="#F4FAFF"> <input type="text"
name="SenderName" size="12">
</td>
</tr>
<tr>
<td bgcolor="#F4FAFF"> 提意见请设定用户名,看意见反馈时输入此用户名;
可以用中文或英文,可以匿名也可以属真实姓名。</td>
</tr>
<tr>
<td width="79" height="25" bgcolor="#0099CC">
<div align="center">
<font color="#FFFFFF">意见内容</font></div></td>
<td bgcolor="#F4FAFF">
<textarea rows="7" name="adviceText" cols="43"></textarea>
</td>
</tr>
</table></td>
</tr>
<tr>
<td> <div align="center">
<input type=submit name=OK value="提交" >
<input type=reset name=reset value="重设">
<input type=submit name=review value="查看意见处理">
</div></td>
</tr> </form>
<tr>
<td>
<% if ReviewLabel=true then %>
<%
Do Until RSReviewadvice.EOF
%>
<table width="100%" border="0" cellspacing="1"
cellpadding="4">
<tr>
<td height="25" colspan="2">
<div align="center"><font color="#FF0000">
您的意见建议处理情况如下</font></div></td>
</tr>
<tr>
<td width="16%" bgcolor="#0099CC"><font
color="#FFFFFF">意见内容</font></td>
<td width="84%" bgcolor="#F4FAFF">
<% Response.write RSReviewadvice("adviceText") %>
</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF">发送日期</font></td>
<td bgcolor="#F4FAFF">
<% Response.write RSReviewadvice("WhenSent") %>
</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF">处理</font></td>
<td bgcolor="#F4FAFF">
<% Response.write RSReviewadvice("Status") %> </td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF">回复</font></td>
<td bgcolor="#F4FAFF">
<% Response.write RSReviewadvice("Comments") %>
</td>
</tr>
<tr>
<td bgcolor="#0099CC"><font color="#FFFFFF">回复时间</font></td>
<td bgcolor="#F4FAFF">
<% Response.write RSReviewadvice("okdate") %> </td>
</tr>
<%
RSReviewadvice.MoveNext
Loop
%>
</table>
<% end if %>
</td>
</tr>
</table> </td>
</tr>
</td>
</tr>
</table>
<table width="770" height="70" border="0"
align="center"
cellpadding="0" cellspacing="0" background="../images/main_bt1.gif">
<tr>
<td><div align="center">
<p><font color="#FFFFFF">~ 江西信息应用技术职业学院信息技术系制作
~<br>
<br>
E-Mail:<a href="mailto:lxlz2050@163.net">lxlz2050@163.net</a>
Tel:0791-5275546</font></p>
</div></td>
</tr>
</table>
</body>
</html>
请找出并分析其中使用的Request对象的QueryString方法代码:
<!--#include file="conn_db.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=gb2312">
<title>《WEB程序设计与应用》网络教学平台</title>
<link href="../mystyle.css" rel="stylesheet"
type="text/css">
<body background="../images/bg.gif" topmargin="0">
<table width="770" height="89" border="0"
align="center" cellpadding="0" cellspacing="0"
background="../images/top-bg.gif">
<tr>
<td width="150" height="90"><div align="right">
<img src="../images/logo.gif" width="120"></div></td>
<td width="300"><div align="right">
<img src="../images/top-2.gif" width="250"
height="70"></div></td>
<td width="403"><img src="../images/top-3.gif"
width="350" height="70"></td>
</tr>
</table>
<table width="770" border="0" align="center"
cellpadding="0" cellspacing="0">
<tr>
<td width="170" height="500" valign="top"
background="../images/bgindex.gif" bgcolor="#FFFFFF">
<table width="100%" border="0" align="center"
cellpadding="0" cellspacing="0">
<tr>
<td height="22" bgcolor="#0099CC">
<div align="center"><a href="../index.asp">返回首页</a></div></td>
</tr>
<tr>
<td height="22" background="../images/07.gif">
<div align="left">
<font color="#FFFFFF"><strong><img src="../images/tb.gif"
width="21" height="14">
教学内容</strong></font></div></td>
</tr>
</table></td>
<td width="10" height="6" background="../images/i-yinying.gif"> </td>
<td width="590" valign="top" bgcolor="#FFFFFF">
<h3 align="center"><br>
<img src="bbs.gif" width="500" height="30">
</h3>
<center>
<p> <a href="publish.asp">发表</a>    
</p>
<table width="85%" border="1" align="center"
cellpadding="4"
cellspacing="0" bordercolor="#0099CC" style="border-collapse:
collapse">
<tr align="center" bordercolor="#FFFFFF"
bgcolor="#0099CC">
<td width="189" ><font color="#FFFFFF">标题</font></td>
<td width="49" ><font color="#FFFFFF">回复数</font></td>
<td width="45" ><font color="#FFFFFF">浏览数</font></td>
<td width="84" ><font color="#FFFFFF">作者</font></td>
<td width="83" ><font color="#FFFFFF">发言时间</font></td>
</tr>
<%
dim sql,rs
sql="select * from article where layer=1 order by submit_date
desc"
set rs=Server.CreateObject("ADODB.Recordset")
rs.Open sql,db,1
if not rs.bof and not rs.eof then
dim page_size
dim page_no
dim page_total
page_size=10
if Request("page_no")="" then
page_no=1
else
page_no=Request("page_no")
end if
session("page_no")=page_no
rs.pagesize=page_size
page_total=rs.pagecount
rs.absolutepage=page_no
dim i,j
i=0
j=page_size
do while not rs.eof and j>0
i=i+1
j=j-1
%>
<tr align="center">
<td width="189"><div align="left">
<a href="hit_num.asp?id=<%=rs("id")%>"><%=rs("title")%></a>
</div></td>
<td width="49"><%=rs("re_num")%> </td>
<td width="45"><%=rs("hit_num")%> </td>
<td width="84"><%=rs("name")%> </td>
<td width="83"><%=rs("submit_date")%> </td>
</tr>
<%
rs.movenext
loop
end if
%>
</table>
<p align="center">
[本页是第<%=page_no%>/<%=page_total%>页]
<% if int(page_no)>1 then %>
[<a href="bbs.asp?page_no=<%=cstr(int(page_no)-1)%>">上一页</a>]
<% end if%>
<% if int(page_no)<int(page_total) then %>
[<a href="bbs.asp?page_no=<%=cstr(int(page_no)+1)%>">下一页</a>]
<%end if%>
</center>
</td>
</tr>
</table>
<table width="770" height="70" border="0"
align="center" cellpadding="0"
cellspacing="0" background="../images/main_bt1.gif">
<tr>
<td><div align="center">
<p><font color="#FFFFFF">~ 江西信息应用技术职业学院信息技术系制作
~<br>
<br>
E-Mail:<a href="mailto:lxlz2050@163.net">lxlz2050@163.net</a>
Tel:0791-5275546</font></p>
</div></td>
</tr>
</table>
</body>
</html>
|