View Full Version : HTML Radio Buttons to CGI
dabney
11-11-2005, 01:50 AM
I have radio buttons on a HTML form, How to I call that information on in CGI?
Only two radio buttons Are you Male Or Female...well if they click Male how do I check that in cgi?
FishMonger
11-11-2005, 06:25 AM
Assuming you have your input tags like this:<input type="radio" name="sex" value="male" default> Male<br>
<input type="radio" name="sex" value="female"> Female<br>
If you're using the CGI module, you could do this:
$sex = param('sex');
if ($sex eq 'Male') {
print "You selected 'Male'\n";
}
else {
print "You selected 'Female'\n";
}
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.