0% found this document useful (0 votes)
9 views3 pages

php_prac_10

The document outlines the design of a registration web page using HTML and PHP, featuring form controls such as text boxes, radio buttons, checkboxes, and a submit button. The HTML file includes fields for name, address, gender selection, and hobbies, while the PHP file processes the form data and displays the user's input. The document provides a complete example of both the front-end and back-end code for handling user registration.

Uploaded by

saeedarwatkar
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)
9 views3 pages

php_prac_10

The document outlines the design of a registration web page using HTML and PHP, featuring form controls such as text boxes, radio buttons, checkboxes, and a submit button. The HTML file includes fields for name, address, gender selection, and hobbies, while the PHP file processes the form data and displays the user's input. The document provides a complete example of both the front-end and back-end code for handling user registration.

Uploaded by

saeedarwatkar
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/ 3

Practical No.

10
1) Design a web page using following form controls: a.Text box, b. Radio button, c.
Check box, d. Buttons
Html file:

<!DOCTYPE html>

<html>

<head>

<title>Registration Form</title>

</head>

<body>

<h2>Registration Form</h2>

<form method="get" action="registration_form1.php">

<label>Name:</label>

<input type="text" name="t1" required>

<br><br>

<label>Address:</label>

<textarea name="t2" cols="50" rows="5" required></textarea>

<br><br>

<label>Your Gender:</label>

<input type="radio" name="gender" value="Male" required> Male

<input type="radio" name="gender" value="Female"> Female

<input type="radio" name="gender" value="Other"> Other

<br><br>
<label>Your Hobbies:</label><br>

<input type="checkbox" name="hobbies" value="Cooking"> Cooking

<input type="checkbox" name="hobbies" value="Singing"> Singing

<input type="checkbox" name="hobbies" value="Drawing"> Drawing

<input type="checkbox" name="hobbies" value="Watching T.V"> Watching T.V

<input type="checkbox" name="hobbies" value="Reading Books"> Reading Books

<br><br>

<input type="submit" value="Submit">

</form>

</body>

</html>

Php file:

<?php

if(isset($_GET["t1"])) {

echo "Your input is: " . $_GET["t1"] . "<br>";

if(isset($_GET["t2"])) {

echo "Your address is: " . $_GET["t2"] . "<br>";

if(isset($_GET["gender"])) {

echo "Your gender is: " . $_GET["gender"] . "<br>";

}
if(isset($_GET["hobbies"])) {

echo "Your hobbies are: " . implode(", ", $_GET["hobbies"]) . "<br>";

?>

Output:

You might also like