Php form submission?

Source: Internet
Author: User
The development environment is Mac integrated environment. mampprohtml uses post to submit a form. The php file echo $ _ POST [] is blank, while the page is blank. The var_dump ($ _ post []) page is used to print null, ask the question: Code: {code ...} demo. PHP file code: {code ...} page... the development environment is Mac, and the Integration Environment is mamp pro.
Html uses post to submit a form. The php file echo $ _ POST [] is blank. The var_dump ($ _ post []) page is used to print null. What is the problem:
Code:

Demo. php file code:


  

The page does not display anything. If echo "hello" is added to the PHP file, it can still be printed normally. What is the problem, in addition, my code can correctly print the form and submit data in the wamp environment.

Reply content:

The development environment is Mac, and the Integration Environment is mamp pro.
Html uses post to submit a form. The php file echo $ _ POST [] is blank. The var_dump ($ _ post []) page is used to print null. What is the problem:
Code:

Demo. php file code:


  

The page does not display anything. If echo "hello" is added to the PHP file, it can still be printed normally. What is the problem, in addition, my code can correctly print the form and submit data in the wamp environment.

You assign the post value to a variable $ user and then echo the value $ user.

Try it

print_r($_POST);

Did you encounter a jump in this situation?

var_dump($_POST['user']);var_dump($_GET['user']);

Submit a form and execute the PHP file once. If you submit a form, php can get the data. If you do not submit the form, open php directly. It is not empty. If you want to verify that the received data is not received, you can create a session, open another PHP file, and echo this session.

This can be used to debug the methods described by several people upstairs.

It is a beginner. This indicates that no data is submitted to PHP for processing in your form.

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.