您的位置:首页 > 编程语言 > PHP开发

WEB安全基础-HTML+PHP实践

2018-01-06 18:21 561 查看
HTML源码如下:test1.html

<html>
<meta http-equiv="Content-Type" charset=utf-8/>

<body>
<h1>Web安全</h1>
<form action="test1.php" method="post">
姓名:<input type="text" name="name"><br>
邮箱:<input type="text" name="email"><br>
<input type="submit" value="点我提交">
<input type="button" value="重新填写">
</form>
</body>


test1.php

<html>
<body>

<?php
if(empty($_POST["name"])){
header("refresh:3;url=http://websecurity.163.com/exam/test1.html"); print('请补全信息,3S跳转...<br>');}
else{echo $_POST["name"]; ?>,欢迎您!<br>
您的邮箱地址是: <?php echo $_POST["email"];}
?>

</body>
</html>


初始状态运行:



当什么都没填的时候:



当填写了数据后:



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  PHP WEB安全 HTML