Home  >  Article  >  php教程  >  php中form表单同时使用POST和GET传递参数说明

php中form表单同时使用POST和GET传递参数说明

WBOY
WBOYOriginal
2016-05-25 16:44:431437browse

在表单中我们有一个method属性,他可以让表单是post与get了,在php中就应该使用对应的get,post来接收了,下面我来介绍一下method参数说明.

1.之前就是用过,在form表单post提交时,action的url传递get参数,服务器端是能获取到的,代码如下:

<?php
print_r($_GET);
print_r($_POST);
?>

2.但是如果你的form提交类型为get,url中传递的参数却是获取不到的,代码如下:

<?php
/** 
 *测试get和post提交
 *@link(http://www.phprm.com)
 */
print_r($_GET);
print_r($_POST);
?>


本文地址:

转载随意,但请附上文章地址:-)

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn