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?
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.