tags:

views:

39

answers:

2

Hello

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?

+3  A: 

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.

David Dorward
<embassement></embassement>
YsoL8
I wouldn't be — it is a limitation that is unique (in my experience) to PHP.
David Dorward
+2  A: 

Buddy you have same name for submit button and radio button :)

ie leaflet

The value get overridden. I HOPE u got it

nik
+1 Nice catch..
zaf
yup! but I also got confused at first
nik