为了方便翻阅,数组全部设置了中文键名
表单基本标签如下
input标签
input标签可以通过type属性值不同,展示不同的效果
常见的基本属性:
type属性值 | 说明 |
---|---|
text | 文本框,用于输入单行文本 |
password | 密码框,用于输入密码 |
radio | 单选框,用于多选一 |
checkbox | 多选框,用于多选多个 |
file | 文件选择,用于上传文件 |
submit | 提交按钮,用于提交 |
reset | 重置按钮,用于重置 |
button | 普通按钮,默认无功能,配合js添加功能 |
文本域
<select name="">
<option value="">文字</option>
</select>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="css/ace.css" />
</head>
<body>
<form action="" method="post">
<table border="1" cellspacing="0" cellpadding="0" width="380">
<tr bgcolor="cornflowerblue">
<td>个人信息</td>
</tr>
<tr>
<td>姓名:<input type=" text" name="姓名" id="" value="" />
</td>
</tr>
<tr>
<td>邮箱:<input type="text" name="邮箱" id="" value="" />
<select name="邮箱后缀">
<option value="@qq.com">@qq.com</option>
<option value="@163.com">@163.com</option>
</select>
</td>
</tr>
<tr>
<td><label>手机号码:</label><input type="text" name="手机号码" id="" value="" /></td>
</tr>
<tr>
<td>
性别 <input type="radio" name="sex" id="" value="男" />男<input type="radio" name="sex" id=""
value="女" />女
</td>
</tr>
<tr>
<td>
<label>爱 好:</label><input type="checkbox" name="爱好1" id="" value="游泳" />游泳<input type="checkbox"
name="爱好2" id="" value="读书" />读书<input type="checkbox" name="爱好3" id="" value="跑步" />跑步
</td>
</tr>
<tr>
<td><label>住 址:</label><select name="住址">
<option value="未选择">请选择</option>
<option value="复旦大学">复旦大学</option>
<option value="清华大学">清华大学</option>
<option value="武汉大学">武汉大学</option>
</select></td>
</tr>
<tr>
<td>自我介绍:<br><textarea rows="8" cols="50"name="自我介绍"></textarea> <input type="submit"="center" value="提交" />
</td>
</tr>
</table>
</form>
<?php
echo '<pre>';
print_r($_POST);
?>
</body>
</html>
网友评论