Radio button help

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
Bucketheadfan
Forum Newbie
Posts: 4
Joined: Fri Dec 24, 2010 1:44 pm

Radio button help

Post 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;
Peec
Forum Commoner
Posts: 33
Joined: Fri Feb 22, 2008 3:58 am

Re: Radio button help

Post 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'];
Post Reply