What are the special meanings of the stem parameters of action in php? See the code

Source: Internet
Author: User
Does the action in php have any special meaning for parameters? See the code I learned php & nbsp; 5 in & nbsp; 5. for error message & nbsp; set to display: & nbsp; the following code is available: & lt; body & gt; & nbsp; & lt; center & gt; does the action in php have any special meanings? See the code
I am studying php 5 and set the error prompt to display:
The following code is available:



Graph (perimeter & Area) Calculator
Rectangle |
Triangle |
Circle




Echo $ _ GET ["action"];

?>


Run http: // localhost/xphp/tuxingjsq. php and click the rectangular triangle and circular link. no error message is displayed.



When I change the action in the link to another name, for example, name, an error message is displayed, such:




Graph (perimeter & Area) Calculator
Rectangle |
Triangle |
Circle




Echo $ _ GET ["name"];

?>


The following error message is displayed:
PHP Notice: undefined index xxx

Excuse me: is this action special? Or other reasons?
Share :???? ????? Graph (perimeter & Area) Calculator
------ Solution --------------------
Action
The purpose is to reach the goal

Of course you can use other words, but the processing program also needs to make corresponding changes.
------ Solution --------------------
Only one name.
------ Solution --------------------
You can also use name to complete your error prompt.
------ Solution --------------------
You don't just need PHP Notice: undefined index xxx
You should provide the complete error message!
------ Solution --------------------
Isn't your php just an echo?

------ Solution --------------------
First

Echo $ _ GET ["action"];

?>
You need to obtain the value of index as action from the $ _ GET array. The $ _ GET array is generated by the php execution engine and is generated by the get parameter in your url, that is, the red part in the example:
Http://www.baidu.com? A = 1 & B = 1
The php execution engine generates two indexes, that is
$ _ GET ['A'] = 1;
$ _ GET ['B'] = 1;
What happens if you GET $ _ GET ['c?
The execution engine will tell you that you didn't give it to me if you cannot find c.

That is, if you pass the action, the php execution engine reports the following error: PHP Notice: undefined index action.
------ Solution --------------------
The above is incorrect.

That is, if you do not pass the action, the php execution engine reports the following error: PHP Notice: undefined index action.
------ Solution --------------------
There must be other places where the previous get action is used.

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.