When a PHP form is submitted, the result shows the file name of the processing form page? Solution

Source: Internet
Author: User
When a PHP form is submitted, the result shows the file name of the processing form page? This is the page where the form is located & lt; html & gt; & lt; head & gt; & lt; title & gt; figure & nbsp; 1.4 & lt;/title & gt; & lt;/head & gt; PHP form submission. what is the file name of the processing form page displayed in the result?
This is the page where the form is located.



Fig 1.4






This is the processing page, only defined


$ Today = date ("l F d, Y ");
?>


Today's Date:
Print ("$ Today ");
Print ("$ YourName, your will be out ");
Print ($ CostOfLunch * $ DaysBuyingLunch );
Print ("dollars this wek.
\ N ");
?>



However, after I click submit, the content of the file is not parsed, but "blance.php" is displayed. 15. php is the file name of the form I process.

Why?

------ Solution --------------------
No receiving parameter


$ Today = date ("l F d, Y ");
$ YourName = $ _ POST ['yourname'];
$ CostOfLunch =$ _ POST ['costoflunch'];
$ DaysBuyingLunch =$ _ POST ['$ DaysBuyingLunch'];
?>


Today's Date:
Print ("$ Today ");
Print ("$ YourName, your will be out ");
Print ($ CostOfLunch * $ DaysBuyingLunch );
Print ("dollars this wek.
\ N ");
?>


------ Solution --------------------
1. do you show that? or in the browser.
2. if the submitted variable may fail, you must use $ _ POST ['Your submitted variable name does not add $.
3. This is simple. If yes. No problem.
------ Solution --------------------
Textbook code should be okay! It may be the setting of the runtime environment!
Currently, $ _ POST ['yourname'] is generally used to obtain the data from the form POST.

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.