$ _ POST and $ _ GET are redundant?

Source: Internet
Author: User
Is $ _ POST and $ _ GET redundant? PHP seems to be able to automatically obtain the data of the post or get request, and does not need to use the $ _ POST or $ _ GET array. Example: & lt ;? $ UserName = $ _ POST ["userName"]; $ PS = $ _ POST ["PS"]; echo & nbsp; "is the user $ _ POST and $ _ GET redundant?
PHP seems to be able to automatically obtain the data of the post or get request. it does not need to be obtained using the $ _ POST or $ _ GET array. For example:
$ UserName = $ _ POST ["userName"];
$ PS = $ _ POST ["PS"];
Echo "the user name you entered is:". $ userName;
Echo"
The password you entered is: ". $ PS;
?>
Even if you can still GET the form data after removing the $ _ POST lines in the code, do I think $ _ POST and $ _ GET are redundant, in addition, I think this is the biggest difference between PHP and ASP. ASP cannot obtain any of the following information without using the request set:
------ Solution --------------------
That's because you enabled register_globals. But register_globals is safe only when it is turned off. it is not good for you to write code like this.
------ Solution --------------------
Which website has your register_globals enabled?

I have prepared a text.
Xxx. php? UserName = abc & PS = 1
Xxx. php? UserName = abc & PS = 2
Xxx. php? UserName = abc & PS = 3
......
Xxx. php? UserName = abc & PS = 999999

This is much more convenient than getting 999999 posts, although post is not difficult.
It would be more fun if you post and upload something.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.