Radio buttons in php

I've written some very basic php code that stores form inputs and displays them after the form is submitted.

For the radio buttons it just says "on". Is there any way I can display the name of the radio button that the user selected? In the html they are all the same name so the user can only select one.
burnedfacelessAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
The answer is yes but we don't know what you're talking about because you haven't shown us your code.  http://www.w3schools.com/html/html_forms.asp  Each radio button in a group will have the same name but a different value.  How are you receiving and displaying the button info?
0
john-formbyCommented:
Hi,

You need to assign a value to each radio button in the group like this:

<input type="radio" name="test" value="1" /> Yes
<input type="radio" name="test" value="0" /> No

Kind Regards,

John
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Loganathan NatarajanLAMP DeveloperCommented:
You can get the value using jquery easily,

ref. http://www.mkyong.com/jquery/how-to-select-a-radio-button-with-jquery/
0
burnedfacelessAuthor Commented:
Thanks man sorry I didn't post any script
0
keyuCommented:
you must need to specify value field inside radio button

if you dont write that it will return "on"

say for example

<input type="radio" name="gender" value="male" /> male
<input type="radio" name="gender" value="female" /> female


For more ref use this link :
http://www.homeandlearn.co.uk/php/php4p10.html

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.