How does html-php fail to receive the option value under the select tag?

Source: Internet
Author: User
How can php not receive the option value under the select tag {code ...} {code ...} var_dump ($ _ GET); the value is not received here, but there is a value in the url address bar because I nested the php syntax in html, but I can receive the value without using this foreach? What I want...

How can php not receive the option value under the select tag?


       
       test 
// Request. php
  $ _ POST, 'Tuesday' =>$ _ POST, 'Wednesday' =>$ _ POST, 'Thursday' =>$ _ POST, 'Friday' =>$ _ POST, 'Saturday' = >$ _ POST, 'sunday' = >$ _ POST); // html is like this! Export clipboard.png] (/img/bVDKLV)

Var_dump ($ _ GET );
// No value is received here

// But the url address bar has a value

// Because I nested the php syntax in html, but can receive the value without using this foreach?

// The result I want is this, but I cannot receive the value?

// This is my final purpose
$ Arr = array (

'monday' => $_POST,'tuesday' => $_POST,'wednesday' => $_POST,'thursday' => $_POST,'friday' => $_POST,'saturday' => $_POST,'sunday' => $_POST

);

// Html is like this

Reply content:

How can php not receive the option value under the select tag?


       
       test 
// Request. php
  $ _ POST, 'Tuesday' =>$ _ POST, 'Wednesday' =>$ _ POST, 'Thursday' =>$ _ POST, 'Friday' =>$ _ POST, 'Saturday' = >$ _ POST, 'sunday' = >$ _ POST); // html is like this! Export clipboard.png] (/img/bVDKLV)

Var_dump ($ _ GET );
// No value is received here

// But the url address bar has a value

// Because I nested the php syntax in html, but can receive the value without using this foreach?

// The result I want is this, but I cannot receive the value?

// This is my final purpose
$ Arr = array (

'monday' => $_POST,'tuesday' => $_POST,'wednesday' => $_POST,'thursday' => $_POST,'friday' => $_POST,'saturday' => $_POST,'sunday' => $_POST

);

// Html is like this

Select is not self-closed

Thank you.
If RESTful is followed, data transmission still uses POST

Then you can use $ _ POST ['key'] to obtain the key.

If the value is not obtained, we recommend that you first use the js console to check whether your key is correct and avoid duplication.

You $ _ GET is empty. if you have not guessed it, the key value is repeated. Why?


You see, foreach is traversing to the end, and what you get is definitely empty.

Therefore, the conclusion is:

Check your key value to avoid duplication.

When you use this obvious errorforeachWhen,HTMLThe page is similarkemu1SuchnameCommon7When you submit the application, the backendphpThe received value is actuallyHTMLThe last one on the pagenameSelect the value of the box, so the value currently received by the backend is onlyWeek 7. Modify thisbugThere are two methods:

  • SetselectOfnameAll values are converted into arrays, suchkemu1Changekemu1[]

  • foreach$rowThe value is also placed inselectOfname, Such{$row}-kemu1, So there are no duplicatesnameValueok

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.