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.
Who is Participating?

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

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.  Each radio button in a group will have the same name but a different value.  How are you receiving and displaying the button info?

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,


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,

burnedfacelessAuthor Commented:
Thanks man sorry I didn't post any script
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 :

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

From novice to tech pro — start learning today.