We have a method attribute in the form, which allows the form to be post and get. In PHP, we should use the corresponding get and post to receive it. Let me introduce the method parameter description below
1. I have used it before. When submitting a form post, the action URL passes the get parameter, which can be obtained by the server:
The code is as follows
代码如下 |
复制代码 |
print_r($_GET);
print_r($_POST);
?>
|
|
Copy code
|
代码如下 |
复制代码 |
/**
*测试get和post提交
*@link(http://www.bKjia.c0m)
*/
print_r($_GET);
print_r($_POST);
?>
|
print_r($_GET);
print_r($_POST);
?>
|
2. But if your form submission type is get, the parameters passed in the url cannot be obtained:
The code is as follows
|
Copy code
/**
*Test get and post submission
*@link(http://www.bKjia.c0m)
*/
print_r($_GET);
print_r($_POST);
?>
http://www.bkjia.com/PHPjc/632751.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632751.htmlTechArticleIn the form we have a method attribute, which allows the form to be post and get, which should be done in php Use the corresponding get and post to receive it. Let me introduce the method parameter description 1....
|
|
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