Why does php form submission use the get method to submit and obtain values, but the post method cannot be obtained? Notice: Undefinedindex: abcinC: xampphtdocsphpstromhello is always displayed. phponline2; that is to say, the post method fails to pass the value, and the directory is in c: xam... why can I use the get Method for php form submission to obtain the value while the post method cannot? It is always displayed:
Notice: Undefined index: abc in C: \ xampp \ htdocs \ phpstrom \ hello. php on line 2;
That is to say, the post method fails to pass the value. The directory is under the c: xampp/htdocs directory.
POST method:
HTML source code:
PHP source code:
Reply content:
Why can I use the get Method for php form submission to obtain the value while the post method cannot? It is always displayed:
Notice: Undefined index: abc in C: \ xampp \ htdocs \ phpstrom \ hello. php on line 2;
That is to say, the post method fails to pass the value. The directory is under the c: xampp/htdocs directory.
POST method:
HTML source code:
PHP source code:
This is only a warning, not an error. Generally, the solution is $ abc = isset ($ _ POST ['abc'])? $ _ POST ['abc']: '';
Check the Request Method and test your code. No problem.
In fact, you can use
Print the content entered at the front end to see if the key value is included.abc
Isset ($ _ POST ['abc'])? $ _ POST ['abc']: '';
Form
If the method is post, $ _ POST ['name'] is used.
If the method is get, use $ _ GET ['name'].