faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

11 of 18 people (61%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

How can I pass a variable with a button(in objective question--A,B,C,D)?

Nov 27th, 2008 10:14
healthy man, dman, Chris Hayes, nickhee wong, http://www.ttnr.org


Make a normal webform (method=post), be sure to name the form elements
and read out the results in the next page from the $_POST array! 
If the form elements are radio buttons:
<form method=post action=nextpage.php>
<input type=radio name=answer value=A>
<input type=radio name=answer value=B>
<input type=radio name=answer value=C>
<input type=radio name=answer value=D>
</form>
nextpage.php:
echo 'The given answer was answer '.$_POST['answer'];
http://www.healthdothealth.com
http://www.healthxhealth.com
http://www.mesotheliomainmesothelioma.com
http://www.healthfirewall.com
http://www.flathealth.com
http://www.healthbodyguard.com