How PHP cannot receive the option value under the Select tab
test
//request.php
$_POST, 'tuesday' => $_POST, 'wednesday' => $_POST, 'thursday' => $_POST, 'friday' => $_POST, 'saturday' => $_POST, 'sunday' => $_POST);// html是这样的![clipboard.png](/img/bVDKLV)
Var_dump ($_get);
The value is not received here
But the URL address bar is a value
Because I have nested PHP syntax inside HTML, but I can receive the value without using this foreach?
I want the effect is this, but not receive the value Oh?
That's what I want to end up with.
$arr = Array (
'monday' => $_POST,'tuesday' => $_POST,'wednesday' => $_POST,'thursday' => $_POST,'friday' => $_POST,'saturday' => $_POST,'sunday' => $_POST
);
The HTML is like this
Reply content:
How PHP cannot receive the option value under the Select tab
test
//request.php
$_POST, 'tuesday' => $_POST, 'wednesday' => $_POST, 'thursday' => $_POST, 'friday' => $_POST, 'saturday' => $_POST, 'sunday' => $_POST);// html是这样的![clipboard.png](/img/bVDKLV)
Var_dump ($_get);
The value is not received here
But the URL address bar is a value
Because I have nested PHP syntax inside HTML, but I can receive the value without using this foreach?
I want the effect is this, but not receive the value Oh?
That's what I want to end up with.
$arr = Array (
'monday' => $_POST,'tuesday' => $_POST,'wednesday' => $_POST,'thursday' => $_POST,'friday' => $_POST,'saturday' => $_POST,'sunday' => $_POST
);
The HTML is like this
Select Do not write self-closing
Thank you for your invitation.
Follow the restful words, pass the data or use the Post form
Then you need to get it, use $_post[' key ' to get it.
If you do not get the value, it is recommended that you first use the JS console to see if your key is correct and avoid duplication.
Your $_get is empty, I have not guessed correctly, is the key value duplicates. Why is it?
You see, foreach is going through to the end, and the last you get is definitely empty.
So, the conclusion is:
检查一下你的key值,避免重复。
So obvious error, when you use foreach
the HTML
page similar to kemu1
the total number of name
7 , when you submit, the backend php
received value will actually be the HTML
last name
selection box in the page value, So the current backend will receive only 7 of the value of the week . bug
There are two ways to change this, as follows
select
the name
values are changed into arrays, such as kemu1
kemu1[]
foreach
The value of the loop is $row
also placed select
name
, such as {$row}-kemu1
, so that there is no duplicate name
valueok