I have this simple form:
<form method="post" action="?step=2">
<label>A4 - Colour / Colour
开发者_运维知识库<input type="radio" name="leaflet" value="1"></label><br>
<label>A5 - Colour / Black
<input type="radio" name="leaflet" value="2"></label><br>
<input type="submit" name="leaflet" value="Select">
</form>
When I apply print_r ($_POST); to the submission though, I only get the submit button data. I don't even see the radio name.
What could do that?
PHP's standard form parsing system (which populates $_POST
) can't handle multiple bits of form data with the same name (unless that name ends with the characters []
).
Change the name of the submit button.
Buddy you have same name for submit button and radio button :)
ie leaflet
The value get overridden. I HOPE u got it
精彩评论