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

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

WBOY
WBOYoriginal
2016-05-25 16:44:431438parcourir

在表单中我们有一个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);
?>


本文地址:

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

Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn