1.wamp Built environment, use post to get form submit data return value is empty
The code is as follows:
Error: notice:undefined index:firstname in E:webweb softwarewampwwwdemotest.php
2.php server is Apache no wrong, port number is also 80 not wrong
3. Try the Get method, still can't get the data
I found my own problem: The HTML file does not open from the same path as the PHP file ~
Reply content:
1.wamp Built environment, use post to get form submit data return value is empty
The code is as follows:
Error: notice:undefined index:firstname in E:webweb softwarewampwwwdemotest.php
2.php server is Apache no wrong, port number is also 80 not wrong
3. Try the Get method, still can't get the data
I found my own problem: The HTML file does not open from the same path as the PHP file ~
Identify a few questions!
1. The test1.html
same test.php
two files in this test are in the same level directory DEMO
.
2. Please do not use the file://
path to access your PHP文件
, so PHP files will not be installed on your computer by the Php.exe interpreter explained.
3. Please use the http://
agreement to access your test1.html
, and correctly fill in the value to submit the form to test.php
.
4. Please note that the beginning of your PHP file 还是 。
确定好以上几点,看看问题是否还存在呢?
测试你的代码并没有问题
Firstname: 改成Firstname: 试试 name 和 value 之间少了一个空格吧
好像没问题啊?
报错:Notice: Undefined index: firstname in E:WebWeb SoftwarewampwwwDEMOtest.php
此错误是一个Notice级的错误,可以忽略,它是想告诉你$firstname还没有被申明就已经在使用了。但是如果不希望它出现,有很多办法。比如修改php.ini中的php_error。