html5-php form Submit Get method can submit get value and post method can not get

Source: Internet
Author: User
Why is a PHP form submission get a value that can be submitted in a Get mode and the Post method is not available, it always shows:
notice:undefined index:abc in C:\xampp\htdocs\phpstrom\hello.php on line 2;
This means that the Post method fails to pass the value, not quite understand, the directory is in the C:xampp/htdocs directory.

Post mode:
HTML Source:

    
  
       Document

PHP Source:


  
   

Reply content:

Why is a PHP form submission get a value that can be submitted in a Get mode and the Post method is not available, it always shows:
notice:undefined index:abc in C:\xampp\htdocs\phpstrom\hello.php on line 2;
This means that the Post method fails to pass the value, not quite understand, the directory is in the C:xampp/htdocs directory.

Post mode:
HTML Source:

    
  
       Document

PHP Source:


  
   

This is just a warning instead of an error generally the workaround is $ABC = isset ($_post[' abc ')? $_post[' abc ']: ';

Look at the request method, put your code on my own test.


  
   

You can actually use it in a PHP script first.

var_dump($_POST);

Print the contents of the front-end input to see if it contains the key valueabc

Isset ($_post[' abc ')? $_post[' abc ']: ';

Form form.
Method is post with $_post[' name ']
Method for get is used $_get[' name ']

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