博客列表 >粘性表单案例

粘性表单案例

yestrue的博客
yestrue的博客原创
2017年12月29日 23:25:37579浏览
<?php
header("content-type:text/html; charset=utf-8");
?>

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.box{
width: 500px;
margin: 0 auto;
}
.grid{
border:1px solid #d9211f;
background-color: #fff5ec;
margin-top:30px;

}
h3{
text-align: center;
}
</style>
</head>
<body>
<div>
<h3>1227粘性表单案例</h3>
<hr>
<form action="" method="POST">
<h3>用户注册</h3>
用户名:<input type="text" id="userName" name="userName" value="<?php echo isset($_POST['userName'])?$_POST['userName']:'' ?>">
<br>
密&nbsp;&nbsp;&nbsp;码:<input type="password" id="passWord" name="passWord" value="<?php echo isset($_POST['passWord'])?$_POST['passWord']:'' ?>">
<br>
性&nbsp;&nbsp;&nbsp;别:<input type="radio" name="gender" value="male" <?php echo (isset($_POST['gender'])&&$_POST['gender']=='male')?'checked':''?>>男
<input type="radio" name="gender" value="female" <?php echo (isset($_POST['gender'])&&$_POST['gender']=='female')?'checked':''?>>女
<br>
学&nbsp;&nbsp;&nbsp;历:<select name="degree" id="degree">
<option value="primary" <?php echo (isset($_POST['degree'])&&$_POST['degree']=='primary')?'selected':'';?>>初级</option>
<option value="middle" <?php echo (isset($_POST['degree'])&&$_POST['degree']=='middle')?'selected':'';?>>中级</option>
<option value="senior" <?php echo (isset($_POST['degree'])&&$_POST['degree']=='senior')?'selected':'';?>>高级</option>
</select>
<br><br>

备&nbsp;&nbsp;&nbsp;注:<textarea name="mark" id="mark" cols="30" rows="10"><?php echo isset($_POST['mark'])?$_POST['mark']:''?></textarea>
<br><br><br>
&nbsp;&nbsp;&nbsp;<button>提交</button>
</form>
</div>

</body>
</html>


上一条:php之连接数据库下一条:php页面分离
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议