Blogger Information
Blog 10
fans 0
comment 0
visits 8512
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
PHP基础练习get/post 2019-04-15
JuJo的博客
Original
1087 people have browsed it

1、PHP运行原理

php运行原理.jpg


2、get

实例

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>get</title>
	<?php
		// echo "<pre>";
		print_r($_GET);
	 ?>
</head>
<body>
	<h2>用户登录</h2>
	<form action="" method="get">
		<p>
			<label>邮箱:</label>
			<input type="email" name="email" value="<?=$_GET['email']?:''  ?>">
		</p>
		
		<p>
			<label>密码:</label>
			<input type="password" name="password" value="<?=$_GET['password']?:''  ?>">
		</p>

		<button>登录</button>
	</form>



	
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

运行预览

微信截图_20190415235952.png


3、post

实例

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>post</title>
	<?php
		// echo "<pre>";
		print_r($_POST);
	 ?>
</head>
<body>
	<h2>用户登录</h2>
	<form action="" method="post">
		<p>
			<label>邮箱:</label>
			<input type="email" name="email" value="<?=$_POST['email']?:''  ?>">
		</p>
		
		<p>
			<label>密码:</label>
			<input type="password" name="password" value="<?=$_POST['password']?:''  ?>">
		</p>

		<button>登录</button>
	</form>



	
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

运行预览

微信截图_20190416000116.png



学习总结:

get传输数据小、post大

post适合传输一些机密信息,如账号、密码


Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post