mysql-php Unable to get form data

Source: Internet
Author: User
Tags php server

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。

  • 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.