Why can't php form submission be submitted in get mode but in post mode? Sit wait

Source: Internet
Author: User
Tags php form
Why can't php form submission be submitted in get mode but in post mode? Wait until the php form submission is submitted in get mode, but not in post mode:
Notice: Undefined index: form in C: \ xampp \ htdocs \ index. php on line 2;
That is to say, the post method fails to pass the value. it cannot be understood that the directory is under the c: xampp/htdocs directory.
Thank you very much for your answers.

Html source code:




Document






Php source code:
1 2 echo 'hello: '. $ _ GET ['form'];
3?>


Reply to discussion (solution)

No form control named form

Html source code:




Document






Php source code:
$ Name = $ _ POST ["abc"];
Echo $ name;
?>

You can change it like this.

Your form is submitted by post, and $ _ GET is used when you take the form.

No form control named form

Form method is post
And when you receive it, you do get
Isn't that a problem?

1. the echo 'hello: '. $ _ GET ['form'] you obtained on the php page; you can use POST to get the value. this is problem 1.

2. form is the form id. I think you want to obtainYou can set a name for it.Then echo 'hello: '. $ _ POST ['id'] on the php page;

I am also a similar problem. there is only one possibility that the port configured by phpstrom does not match the phpinfo () port. Let's take a look. Phpinfo ()?> For example, localhost, configure phpstrom-> Tools-> Dployment-> Configuration->
Create a new file, such as Name = localhost, and set the Web sever root url to http: // localhost. the port must be consistent with the phpinfo () port.

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.