0% found this document useful (0 votes)
11 views2 pages

pr10 (WBP)

The document contains a practical assignment for designing a web page with form controls including text boxes, checkboxes, radio buttons, and a submit button. It includes HTML code for a registration form and PHP code to process the form data. The output displays the user's name, selected gender, and selected skills based on the form submission.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

pr10 (WBP)

The document contains a practical assignment for designing a web page with form controls including text boxes, checkboxes, radio buttons, and a submit button. It includes HTML code for a registration form and PHP code to process the form data. The output displays the user's name, selected gender, and selected skills based on the form submission.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Name: Shreyas Liladhar Lokhande Roll No: 41

Class: TYCM Batch: B

Subject: WBP

Practical No & Name: 10. Design a web page using following form controls :
a. Text Box
b. CheckBox
c. RadioButton
d. Button

HTML Code:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Registration Form</title>
</head>
<body>
<h2>Registration Form</h2>
<form action="submit.php" method="post">
Full Name: <input type="text" name="name" required>
<br><br>
Email: <input type="email" name="email" required>
<br><br>
Gender:
<input type="radio" name="gender" value="Male"> Male
<input type="radio" name="gender" value="Female"> Female
<input type="radio" name="gender" value="Other"> Other
<br><br>
Skills:
<input type="checkbox" name="HTML" value="HTML"> HTML
<input type="checkbox" name="CSS" value="CSS"> CSS
<input type="checkbox" name="JavaScript" value="JavaScript"> JavaScript
<br><br>
Password: <input type="password" name="password" required>
<br><br>
<button type="submit">Register</button>
</form>
</body>
</html>
PHP Code:
<?php
$name = $_POST["name"];
$email=$_POST["email"];
$gender=$_POST["gender"];
$HTML=$_POST["HTML"];
$CSS=$_POST["CSS"];
$JavaScript=$_POST["JavaScript"];
echo "Name is: ".$name."<br>";
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
echo "Invalid email format! <a href='index.html'>Go Back</a>";
}
if(isset($gender))
{
echo "You selected radio button:".$gender."<br>";
}
if(isset($HTML))
{
echo "You selected checkbox : ".$HTML."<br>";
}
if(isset($CSS))
{
echo "You selected checkbox : ".$CSS."<br>";
}
if(isset($JavaScript))
{
echo "You selected checkbox : ".$JavaScript."<br>";
}

?>

Output :
Name is: Shreyas Lokhande
You selected radio button: Male
You selected checkbox : CSS

You might also like