Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Radio button group

Status
Not open for further replies.

OOP

Programmer
Feb 5, 2001
94
SG
Hi,
Recently started to use Dreamweaver to program PHP. I'm running into a problem as to how can i check for which radio button in a group has been selected by user?

I have a radio button group (2 radio buttons) called Realmselect. How to write source code to check which one is selected upon submit button is pressed?

Thanks for your patient in advance to explain this simple concept :)
 
ok, i've found the solution already.
Just to give an update and info about this, my above problem can be solved by using $HTTP_POST_VARS[name of the radio group] and each radio buttons is assigned a different name.
Therefore, upon the submit button is clicked, the $HTTP_POST_VARS[name of the radio group] will equal to the name of the radio button (depends on which one is clicked)

For example,

if($HTTP_POST_VARS[name of the radio group] == 'name of radio button') {

process
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top