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 errorforeach
When,HTML
The page is similarkemu1
Suchname
Common7When you submit the application, the backendphp
The received value is actuallyHTML
The last one on the pagename
Select the value of the box, so the value currently received by the backend is onlyWeek 7. Modify thisbug
There are two methods:
Setselect
Ofname
All values are converted into arrays, suchkemu1
Changekemu1[]
foreach
$row
The value is also placed inselect
Ofname
, Such{$row}-kemu1
, So there are no duplicatesname
Valueok