When a PHP form is submitted, the result shows the file name of the processing form page? This is the page on which the form is located & lt; html & gt; & lt; head & gt; & lt; title & gt; figure & nbsp; 1.4 & lt; title & gt; & lt; head & gt; & lt; body & gt; & lt; form & nbsp; action PHP form submission. is the file name displayed for processing the form page?
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.