Mysql-php cannot obtain form data

Source: Internet
Author: User
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.

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.