实验三 用HTML制作网页――表单与ASP
一、实验目的
掌握表单的设计
用ASP处理表单信息
二、实验环境
Windows98/2000/XP
PWS3.0及以上版本或IIS3.0及以上版本
三、实验内容
(如图)
设计如图1所示的表单网页,当输入如图2的信息并单击“提交”按钮后,显示如图3所示的网页(可填写自己的信念)。
我帮我同学问的,再说,人有长处和短处,什么都懂那不是人,是神。楼下那位不好意思,百度里,我等级还比你高,就这点,你没什么资格这么说
第一个html页面代码如下:
<!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>
</head>
<body>
<form id="form1" name="form1" method="post" action="tijiao.asp">
<p>姓名:<input name="xingming" type="text" /></p>
<p>性别: <input name="xingbie" type="radio" value="男" />男 <input name="xingbie" type="radio" value="女" />女</p>
<p>户籍:
<select name="huji">
<option value="上海市">上海市</option>
<option value="北京市">北京市</option>
<option value="天津市">天津市</option>
</select>
</p>
<p>兴趣:<br>
<li> <input name="xingqu" type="checkbox" value="电脑" />电脑<br></li>
<li> <input name="xingqu" type="checkbox" value="体育" />体育<br></li>
<li> <input name="xingqu" type="checkbox" value="游戏" />游戏<br></li>
<li> <input name="xingqu" type="checkbox" value="音乐" />音乐<br></li>
<li> <input name="xingqu" type="checkbox" value="电影" />电影<br></li>
</p>
<p>留言:</p>
<p>
<textarea name="liuyan" cols="50" rows="3"></textarea>
</p>
<input name="" type="submit" value="提交" /> <input name="" type="reset" value="重置" />
</form>
</body>
</html>
第二个页面tijiao.asp代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!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>
</head>
<body>
<font color="#993399"><DIV align="center"><%=request("xingming")%><%if request("xingbie")="男" then%>先生<%elseif request("xingbie")="女" then%>小姐<%else%>错误:未选择性别<%end if%>:欢迎您!</DIV>
<DIV align="center">您是<%=request("huji")%>人</DIV>
<DIV>您喜欢的是:<br>
<%=request("xingqu")%>
</DIV>
<DIV>您的留言是:<br>
<%=request("liuyan")%>
</DIV></font>
</body>
</html>