Exp 10 PHP

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Name : Shaikh Hassaan

Roll No : 210418
Practical No : 10
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.
<html>
<body>
<h1>HTML Controls</h1>
<form name="myform" action="Exp10.php" method="post">
Enter Name : <input type="text" placeholder="Enter the name" name="name"><br>
Enter Gender : Male<input type="radio" name="gender" value="male" >Female<input
type="radio" name="gender" value="female"><br>
Enter hobbies : Cricket<input type = "checkbox" name="check1" value="cricket"
>Football<input type = "checkbox" name="check2" value="Football" >Kabaddi<input type = "checkbox"
name="check3" value="Kabaddi">
<input type="submit" value="submit">
</form>

</body>
</html>
<?php
$name = $_POST['name'];
$gender = $_POST['gender'];
$hobby1 = $_POST['check1'];
$hobby2 = $_POST['check2'];
$hobby3 = $_POST['check3'];
echo $name. " " . $gender ." ".$hobby1." ".$hobby2." ".$hobby3." ";

?>

You might also like