html5表单与PHP交互

1、示例代码

前端:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>html5表单与PHP交互</title>
</head>
<body>
<form action="http://localhost/jh.php" method="post" target="_blank"><!--需要资源定位可用get方式提交单get不安全性也是有的,并且网址长-->
<p>用户名:<input type="text" name="user" autofocus="autofocus"/></p>
<p>密&nbsp;码:<input type="password" name="password"/></p>
<input type="submit"/>
</form>
</body>
</html>

后端:

<?php
echo "用户名:".$_POST['user']."<br/>密&nbsp;码:".$_POST['password'];
?>

2、实例效果

 

posted @ 2017-08-19 13:50  牛新龙的IT技术博客  阅读(948)  评论(0编辑  收藏  举报