radio buttons

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
phoenix121
Forum Commoner
Posts: 28
Joined: Sun Sep 25, 2005 9:09 pm
Location: New Zealand

radio buttons

Post by phoenix121 »

if i make a form with radio buttons and the user clicks submit, do i use the value of the radio button in the POST superglobal variable?

eg.

Code: Select all

<input type="radio" name="gender" value="male">Male<br>
<input type="radio" name="gender" value="female">Female
should i use $_POST['male'] or $_POST['female']or some other way of notation?
User avatar
thomas777neo
Forum Contributor
Posts: 214
Joined: Mon Mar 10, 2003 6:12 am
Location: Johannesburg,South Africa

Post by thomas777neo »

Well, you would use $_POST['gender'] to get the value sent.
Post Reply