题目2:根据下图进行编程

1

2


效果:

效果

解题:

->unit4_2.html

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html;charset=gb2312">
        <title>个人信息</title>
    </head>
    <body>
        <h2 align="center">请填写个人信息</h2>
        <div align="center">
            <form action="unit4_2.asp" method="post" >
                姓名:<input type="text" name="name" /><br />
                密码:<input type="password" name="pwd"/><br />
                性别:
                <input type="radio" name="sex" value="男" checked="checked">男
                <input type="radio" name="sex" value="女">女<br/>
                爱好:
                <input type="checkbox" name="hobby" value="计算机">计算机&nbsp
                <input type="checkbox" name="hobby" value="音乐">音乐&nbsp
                <input type="checkbox" name="hobby" value="旅游">旅游<br/>
                职业:
                <select name="job">
                    <option value="教育业">教育业</option>
                    <option value="医生">医生</option>
                    <option value="司机">司机</option>
                </select>
                <br />
                简述:
                <textarea rows="10" cols="30" name="p_resume"></textarea><br />
                <input type="submit" name="Submit" value="确定">&nbsp
                <input type="reset" name="reset" value="重新填写"><br/>
            </form>
        </div>        
    </body>
</html>

->unit4_2.asp

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>信息确认</title>
        
    </head>
    <body>        
        <%@Language="vbscript" Codepage="65001"%>
        <%
            dim name,pwd,sex,hobby,job,p_resume
            name = request.form("name")
            pwd = request.form("pwd")
            sex = request.form("sex")
            hobby = request.form("hobby")
            job = request.form("job")
            p_resume = request.form("p_resume")
            response.write "<h3>这是你的个人信息</h3>"
            response.write "<br/>姓名:" & name 
            response.write "<br/>密码:" & pwd
            response.write "<br/>性别:" & sex
            response.write "<br/>爱好:" & hobby
            response.write "<br/>职业:" & job
            response.write "<br/>简介:" & p_resume
            
        %>
    </body>
</html>

测试页面:

unit4_2.html