Name: Midhat Ansari Roll no: 210403
Sub: Web Based Application Development with PHP (WBP) Branch: CO
Experiment No. 10: Design a web page using following form controls:
Textbox, Radio button, Check box, Buttons
1. Write a Program for designing a Webpage using Textbox, Radio button, Checkbox
and Buttons and display all the data that is entered by user.
CODE:
html file:
<html>
<body>
<form method="POST" action="exp10.php">
Name: <input type="text" name="name"><br>
Gender: <input type="radio" name="rd" value="Male">Male
<input type="radio" name="rd" value="Female">Female<br>
Sem 6 subjects:<input type="checkbox" name="cb" value="WBP">WBP
<input type="checkbox" name="cb[]" value="DCC">DCC
<input type="checkbox" name="cb[]" value="MAD">MAD
<input type="checkbox" name="cb[]" value="DMS">DMS
<input type="checkbox" name="cb[]" value="CGR">CGR<br><br>
<input type="submit">
</form>
</body>
</html>
php file:
<?php
echo "Name: ".$_POST['name']."<br>";
echo "Gender: ".$_POST['rd']."<br>";
$sub = $_POST['cb'];
echo "Sem 6 sub: ";
foreach ($sub as $arr) {
echo $arr."<br>";
}
?>
OUTPUT: