/*
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This Code will explain the handling of Radio buttons in Php
Author : Rakesh Vashisht
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
We can handle Radio buttons in Php Either bY using if statement or by using switch ststement.
switch is more useful than using if else.
to complie this statement u should first create a HTML file.
-> then create three radio button :- teacher , doctor, engineer
then use this file as code for these radio buttons
*/
switch($_POST["radiobutton"]) //we set the switch on the type radio which we create in the html file
{
case "teacher":
$val="teacher"; // if we pick the 'teacher' then the value will be get this parameter
break;
case "doctor":
$val="doctor"; // if we pick the 'doctor' then the value will be get this parameter
break;
case "engineer":
$val="engineer";
// if we pick the 'engineer' then the value will be get this parameter
default:
$val="teacher";
}
echo "the option u have pick is ".$val;
?>