Connecting Tech Pros Worldwide Help | Site Map

post values from html form radio buttons

tolkienarda's Avatar
Needs Regular Fix
 
Join Date: Dec 2006
Posts: 316
#1: Jan 18 '07
hi all

i am reciving several $_POST variables from a form on an html page and i was curious if in my
if (isset($_POST['variablefromhtml']))
statement is using the id or the name of the radio button.
if the name value is used and i have 9 radio buttons int the same form how do i go about determining which value i am getting. cause the php script will redirect either delete entries from a mysql table or redirect me to a page.
ronverdonk's Avatar
Moderator
 
Join Date: Jul 2006
Location: The Netherlands
Posts: 4,139
#2: Jan 18 '07

re: post values from html form radio buttons


Quote:

Originally Posted by tolkienarda

hi all

i am reciving several $_POST variables from a form on an html page and i was curious if in my
if (isset($_POST['variablefromhtml']))
statement is using the id or the name of the radio button.
if the name value is used and i have 9 radio buttons int the same form how do i go about determining which value i am getting. cause the php script will redirect either delete entries from a mysql table or redirect me to a page.

In the $_POST array you find the name of the HTML <input> statement as the entry's key and the value of that statement as the entry's value. So for buttons you'll get (of course) 1 name and the value of the particular button clicked.

Ronald :cool:
Reply