PHP CODE FOR RADIO GROUP

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

antoakatoe
New php-forum User
New php-forum User
Posts: 1
Joined: Thu Nov 08, 2012 4:30 pm

PHP CODE FOR RADIO GROUP

Postby antoakatoe » Thu Nov 08, 2012 4:45 pm

Hi Guy's,

new to php and need to code for a form submit to email. I think i have my text fields correct i am having trouble with the radio group:

Here is html for one of my radio groups:

Image

here is my current data variables for text fields:

Image

I was thinking that perhaps this would work??

$foodquality = $_POST['fq1'];
$foodquality = $_POST['fq2'];
$foodquality = $_POST['fq3'];
$foodquality = $_POST['fq4'];
$foodquality = $_POST['fq5'];

any help would be grately appreciated.

Anthony

User avatar
simplypixie
php-forum Active User
php-forum Active User
Posts: 300
Joined: Sun Dec 11, 2011 12:51 am
Location: Shrewsbury, Shropshire
Contact:

Re: PHP CODE FOR RADIO GROUP

Postby simplypixie » Thu Nov 08, 2012 11:46 pm

You need to make foodquality an array, so change each name in your form to

Code: Select all

name="foodquality[]"


Then loop through this array when you need to get the values


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 2 guests