+ 1
input tag
<input type="checkbox" name="gender" value="1" /> Male <br /> <input type="checkbox" name="gender" value="2" /> Female <br /> in this example ,why the name of 2 input are equal?
5 ответов
+ 4
Planet
+ 1
Whoever wrote this example is trying to submit the selected checkboxes into PHP, So the script will know which boxes have been selected by the user and act accordingly..
Use echo @$_POST['gender']
it will echo either number 1 or 2, considering the selected box.
Cheers! :)
0
Because you wrote it so? For what you're trying to do it's better to use a select (those drop down fields)
0
Planet
- 2
false question