Home > php教程 > php手册 > body text

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

WBOY
Release: 2016-05-25 16:44:43
Original
1438 people have browsed it

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

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

<?php
print_r($_GET);
print_r($_POST);
?>
Copy after login

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

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


本文地址:

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!