1. in the wamp environment, use post to obtain the data submitted by the form. the returned value is empty. the code is as follows: {code ...} {code ...} error: Notice: Undefinedindex: firstnameinE: WebWebSoftwarewampwwwDEMOtest. the php2.php server is Apache and the port number is also...
1. the wamp environment is set up, and the returned value of the data submitted by the form is null when The post is used.
The code is as follows:
Error: Notice: Undefined index: firstname in E: WebWeb SoftwarewampwwwDEMOtest. php
2. the php server is Apache and the port number is also 80.
3. try the get method and still cannot get data
I found my own problem: the html file is not opened from the same path as the php file ~
Reply content:
1. the wamp environment is set up, and the returned value of the data submitted by the form is null when The post is used.
The code is as follows:
Error: Notice: Undefined index: firstname in E: WebWeb SoftwarewampwwwDEMOtest. php
2. the php server is Apache and the port number is also 80.
3. try the get method and still cannot get data
I found my own problem: the html file is not opened from the same path as the php file ~
Are you sure you want to solve the problem!
1.test1.htmlSametest.phpBoth files are in the same level DirectoryDEMO.
2. do not usefile://Path to access yourPhp fileThe PHP file will not be explained by the php.exe interpreter installed on your computer.
3. usehttp://Protocol access to yourtest1.htmlAnd enter the correct value to submit the formtest.php.
4. Note the beginning of your php file Or 。
Are you sure you want to check whether the problem persists?
There is no problem in testing your code
Firstname:Change to Firstname:Try missing a space between name and value.
It seems that there is no problem?
Error: Notice: Undefined index: firstname in E: WebWeb SoftwarewampwwwDEMOtest. php
This error is a Notice-level error and can be ignored. it is intended to tell you that $ firstname is already in use before it is declared. But if you don't want it to appear, there are many ways. For example, modify php_error in php. ini.