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.