tags:

views:

541

answers:

2

Hi,

I have a sendemail.php set up for sending me information from a form.

The way I have it set to send the information is with

$_POST['variable name']

I cant figure out how to show the choice of a radio button array in the email that is sent to me. Thanks for any help.

+3  A: 

Well, all radio buttons in a group necessarily have the same name, to be grouped together. They should each be given a different value. For example, your HTML could look like this:

<input type="radio" name="gender" value="male" id="gender_male" />
    <label for="gender_male">Male</label>
<input type="radio" name="gender" value="female" id="gender_female" />
    <label for="gender_female">Female</label>

Then on your sendemail.php, you look at the value of $_POST['gender'], which will be either "male" or "female", depending which one of the radio buttons they had selected.

Chad Birch
A: 

Every radio button has to have a value set. You get the value of the selected button with $_POST['name of radio button'].

Anders S