[web][学习随笔]php中http post&get数据传输

GET

<!--客户端发送-->
<form id="form1" action="doGet.php" method="get">
	<input type="text" name="user1"><br/>
	<input type="password" name="password1"><br/>
	<input type="submit" value="GET方式提交"/>
</form>
//服务端处理
//doGet.php
<?php
	echo $_GET['user1'];
	echo "<br/>";
	echo $_GET['password1'];
?>

POST

<!--客户端发送-->
<form id="form2" action="doPost.php" method="post">
	<input type="text" name="user2"><br/>
	<input type="password" name="password2"><br/>
	<input type="submit" value="POST方式提交"/>
</form>
//服务端处理
<?php
	echo $_POST['user2'];
	echo "<br/>";
	echo $_POST['password2'];
?>

猜你喜欢

转载自www.cnblogs.com/alidydb/p/12904928.html