Questions about the form $ _ post []

Source: Internet
Author: User
The question form action in the form $ _ post [] points to the submit button on the page where it is located & lt; input & nbsp; namesearch & nbsp; typesubmit & nbsp; value query & nbsp; & gt; The following is a judgment & nbsp; if ($ _ Get [search]). if a value exists, the query button is clicked, what to execute? operation form $ _ post []
The form action points to its own page
Submit button

Here is a judgment if ($ _ Get ['search'])
If there is a value, it means you have clicked the query button to perform what operations
If there is no value, only the static part of this page is displayed.

5.3 run
The web page cannot be displayed after PHP5.5 is used.

A solution is provided. What's going on? All code needs to be rewritten?
------ Solution ----------------------
$ _ GET [search]
Without quotation marks. PHP first looks for the search constant, so an error is returned if it cannot be found.

If you do not want to change the code, you can add: error_reporting (E_ALL &~ E_NOTICE); this statement can block the notice error report.
------ Solution ----------------------
You can enable error debugging. if the webpage cannot be displayed, what is the problem.
------ Solution ----------------------
Adding parameters is a standard method.
Why is it not labeled ..
------ Solution ----------------------
The cause of this error message is that PHP regards the key name that is not enclosed in quotation marks as a constant for obtaining the key name. when it cannot be found, it throws a NOTICE, then generate a string based on the "constant name", and then talk about this string as the key name to continue ~

You can set error_reporting (E_ALL &~ E_NOTICE); to block the implicit representation. But it is better to add a quote, so you do not need to take the constant delimiter character multiple times to improve efficiency.
------ Solution ----------------------
This is irrelevant to the php version, but it is related to the php environment settings.
Of course, with the upgrade of the php version, you are subject to the upgrade.

If ($ _ Get ['search']) may generate an error message at the E_NOTICE level.
If you do not enable the error display, or redirect the error information to the log
Therefore, the error message has no way out, resulting in an HTTP 500 status (the server rejects the response)

Although the E_NOTICE-level error check is blocked, this problem can be avoided.
But after all, hidden risks exist, and programs are not robust.

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.