Page 1 of 1

Radio button help

Posted: Mon Jan 24, 2011 7:36 pm
by Bucketheadfan
This is a section of my form. I cannot get my email message to show the value of this text box array when one is selected.

<input type="radio" name="Dog Scale" value="1" />1
<input type="radio" name="Dog Scale" value="2" />2
<input type="radio" name="Dog Scale" value="3" />3
<input type="radio" name="Dog Scale" value="4" />4
<input type="radio" name="Dog Scale" value="5" />5

Here is a section of my php.

<?php
$name=$_POST['Name'];
$address=$_POST['Address'];
$city=$_POST['City'];
$email=$_POST['Email'];
$catscale=$_POST['Cat Scale'];

if(!filter_var($email, FILTER_VALIDATE_EMAIL))
{
die('Invalid email address.');
}

$email_from=$email;
$email_subject="Foster Form Submission";
$email_body=
<<<HTML
Name:$name
Email:$email
Cat Scale:$catscale
HTML;

Re: Radio button help

Posted: Mon Jan 24, 2011 9:20 pm
by Peec
From what i see you are posting.


name="Dog Scale"

..... and ....

$catscale=$_POST['Cat Scale'];

Switch either all "Dog Scale" with "Cat Scale" on input fields or change $catscale=$_POST['Cat Scale']; to $catscale=$_POST['Dog Scale'];