Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

PHP CODE FOR RADIO GROUP

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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
antoakatoe
New php-forum User
New php-forum User
 
Posts: 1
Joined: Thu Nov 08, 2012 4:30 pm

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
User avatar
simplypixie
php-forum Active User
php-forum Active User
 
Posts: 300
Joined: Sun Dec 11, 2011 12:51 am
Location: Shrewsbury, Shropshire


Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron