0% found this document useful (0 votes)
10 views55 pages

WBP

Uploaded by

zdi12966
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views55 pages

WBP

Uploaded by

zdi12966
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 55

Practical File on

Web Based Programming 313

Information Technology Management


Bachelor of Computer Application (BCA)
Guru Gobind Singh Indraprastha University, Delhi

Submitted To: Submitted By:


Ms. Suman Name: Anuj
(Assistant Professor - IT) EnrollmentNo:00921102020

Institute of Information Technology & Management


S. No. Problem Statement Date
1. Design the following static web pages required for an online book store web site. 16-09-2022
A. HOME PAGE: The static home page must contain three frames.
B. LOGIN PAGE
C. CATOLOGUE PAGE: The catalogue page should contain the details
of all the books available in the web site in a table.
D. REGISTRATION PAGE

2. Write JavaScript to validate the following fields of the Registration page. 23-09-2022
A. First Name (Name should contains alphabets and the length should not
be less than 6 characters).
B. Password (Password should not be less than 6 characters length).
C. E-mail id (should not contain any invalid and must follow the
standard pattern [email protected])
D. Mobile Number (Phone number should contain 10 digits only).
E. Last Name and Address (should not be Empty).

3. Write and explain the installation steps and method of PHP using screen shots. 30-09-2022
PHP can be installed using two ways:
1) Using WAMP
2) Using XAMP

4. Write a script to echo the following to the browser, using the variable you created: 30-09-2022
“What goes around, comes around.”

5. Write a PHP Script to calculate the area and circumference of circle. 07-10-2022

6. Write a script to reproduce the output below. Manipulate only one variable using 07-10-2022
simple and using no simple arithmetic operators (assignment operator s) to
produce the values given in the statements. In the script each statement ends with
"Value is now $variable."
Value is now 8.
Add 2. Value is now 10.
Subtract 4. Value is now 6.
Multiply by 5. Value is now 30.
Divide by 3. Value is now 10.
Increment value by one. Value is now 11.
Decrement value by one. Value is now 10.

7. Write a script using one variable “$whatisit” to print the following to the browser. 07-10-2022
Your echo statements may include no words except “Value is”.
Value is string.
Value is double.
Value is boolean.
Value is integer.
Value is NULL.

8. Write a PHP scripts to differentiate the print and echo command 14-10-2022

9. Write a script to display implicit casting and explicit casting 14-10-2022

10. Write a PHP scripts to differentiate the $ and $$. 14-10-2022

11. Write a program to calculate Electricity bill in PHP 21-10-2022


Conditions:
For first 50 units – Rs. 3.50/unit
For next 100 units – Rs. 4.00/unit
For next 100 units – Rs. 5.20/unit
For units above 250 – Rs. 6.50/unit
Hint:-You can use conditional statements.

12. Write a PHP script using nested for loop that creates a chess board 21-10-2022

13. Write a PHP program to find three numbers from an array such that the sum of 21-10-2022
three consecutive numbers equal to zero.

14. Create an index array with value red, green, orange, blue, pink, white and black, 28-10-2022
Count the total array and display all values of array using for loop.

15. Create an Associative array with value fruits, veggie, dry-fruits and Count the 28-10-2022
total array and display all values of array using for each loop.

16. Create an Multidimensional Array and Display the array with index and values 28-10-2022
using <pre> tag.

17. Write a PHP script to sort the following associative array : 28-10-2022
array("Sophia"=>"31","Jacob"=>"41","William"=>"39","Ramesh"=>"40") in
a) ascending order sort by value
b) ascending order sort by Key
c) descending order sorting by Value
d) descending order sorting by Key

18. WAP to swap two values (call by reference) using function 04-11-2022

19. WAP to create a PHP form according to the given format 04-11-2022
20. Design a form given below with validation and error message in PHP 11-11-2022

21. Write a PHP Script to demonstrate the file handling in 18-11-2022


php(fopen,fclose,fread,fwrite,file length)

22. Write a program to upload a file. 18-11-2022

23. Write a program to store the current date and time in a cookie and display the last 25-11-2022
visited date and time on the web page

24. Write a program to store page views counting session to increment the count on 25-11-2022
each refresh and to show the count on the page

25. Write and explain the steps to create a database, table, select query using 2-12-2022
PhpMyadmin.

26. Write a PHP program to 16-12-2022


 create a connection,
 create a database and
 create a table
27 Write a PHP program for sending and receiving plain text message (e -mail). 16-12-2022
28. Write a PHP program to insert record into a table 23-12-2022
29. Write a PHP program to select data and show into table format 23-12-2022
30. Create a student Registration in PHP and Save and Display the student Records. 30-12-2022
Q.1 Design the following static web pages required for an online book store web site.

A. HOME PAGE: The static home page must contain three frames.
B. LOGIN PAGE
C. CATOLOGUE PAGE: The catalogue page should contain the details of all the
books available in the web site in a table.
D. REGISTRATION PAGE

Code:

Q.2 Write JavaScript to validate the following fields of the Registration page.

A. First Name (Name should contains alphabets and the length should not be less than
6 characters).
B. Password (Password should not be less than 6 characters length).
C. E-mail id (should not contain any invalid and must follow the standard pattern
[email protected])
D. Mobile Number (Phone number should contain 10 digits only).
E. Last Name and Address (should not be Empty).

Code:

<html>

<head>

<title>Registration Form</title>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<style type="text/css">

.col-lg-9 {

float: right;

margin-top: -80px;

margin-right: 500px;

color: white;

}
.container {

background-color: #ac2727;

min-height: 300px;

.img-pos {

z-index: 999;

position: relative;

left: 70px;

top: 50px;

.container2 {

margin-top: 40px;

text-align: center;

max-width: 400px;

position: relative;

left: 700px;

</style>

</head>

<body>

<div class="container">

<div class="row">
<div class="col-lg-3">

<img class="img-pos" src="iitm-new_logo.jpg" height="82" width="160" alt="">

</div>

<div class="col-lg-9">

<h1>Institute of Information Technology & Management</h1>

<h3>Accredited Grade "A" by National Assessment and Accreditation Council


(NAAC)</h3>

<h3>Approved by AICTE</h3>

<h3>Rated as Category 'A+' by SFRC & 'A' by JAC Govt. of NCT of Delhi</h3>

<h3>Recognised U/s 2(f) of UGC Act</h3>

<h3>Affiliated to Guru Gobind Singh Indraprastha University, New Delhi</h3>

</div>

</div>

</div>

<div class="container2">

<form action="" method="get">

<fieldset>

<legend>Contact Details</legend>

<label for="fname">First Name:</label>

<input type="text" id="name" name="fname" minlength="6"><br><br>

<label for="name">Last Name:</label>

<input type="text" id="lname" name="lname" required><br><br>

<label for="password">Password:</label>

<input type="password" id="password" name="password" minlength="6"><br><br>

<label for="email">Email:</label>
<input type="email" id="email" name="email"><br><br>

<h2 id="result"></h2><br><br>

<label for="phone">Phone Number:</label>

<input type="numberic" id="phone" name="phone" maxlength="10"


onkeypress="return validateNumber(event)"><br><br>

<label for="address">Address:</label>

<textarea name="address" id="address" cols="25" rows="2"


required></textarea><br><br>

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

</fieldset>

</form>

</div>

<script type="text/javascript">

const validateEmail = (email) => {

return email.match(

/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]
{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/

);

};

const validate = () => {

const $result = $('#result');

const email = $('#email').val();

$result.text('');
if (validateEmail(email)) {

$result.text(email + ' is valid :)');

$result.css('color', 'green');

} else {

$result.text(email + ' is not valid :(');

$result.css('color', 'red');

return false;

$('#email').on('input', validate);

function validateNumber(e) {

const pattern = /^[0-9]$/;

return pattern.test(e.key)

</script>

</body>

</html>
Output:
Q.3 Write and explain the installation steps and method of PHP using screen shots.

PHP can be installed using two ways:


1) Using WAMP
2) Using XAMP

Ans-
1)Using WAMP
Step 1:To download the WAMP Server, visit the "wamp server website in your web browser.
Click on the "WAMP SERVER 64 BITS (X64).

Step 2: Now, click on the "download directly" link to start downloading.

Step 3: Double-click the downloaded file to launch the WAMP installer. "Select Setup
Language" window will appear on the screen and then choose your preferred language.

Step 4: Under the "License Agreement", click on the "I accept the agreement" radio button and
then click on the "Next" button then Click on the "Next" button.
Step 5: Choose a location (folder) to install the WAMP server and click on the "Next" button.

Step 6: Select the start menu folder. "Ready to Install" window will appear on the screen and
then, click on the "Next" button.

Step 7: Now, select the default browser and default text editor for the wamp server. Click on the
"Finish" button.
2) Using XAMP
Step 1:search xampp server or visit apachefriends.org.
Step 2: click on download according to the your platform and Once the software bundle has been
downloaded, you can start the installation by double clicking on the file.
Step 3:setup the wizard

Step 4: Under ‘Select Components’, you have the option to exclude individual components of the
XAMPP software bundle from the installation. But for a full local test server, we recommend
you install using the standard setup and all available components. After making your choice,
click ‘Next’.

Step 5: Choose the installation directory


Step 6: Once all the aforementioned preferences have been decided, click to start the installation.
The setup wizard will unpack and install the selected components and save them to the
designated directory.
Click to tick the corresponding check box and open the XAMPP Control Panel once the
installation process is finished.
Step 7: Once all the components are unpacked and installed, you can close the setup wizard by
clicking on ‘Finish’. Click to tick the corresponding check box and open the XAMPP Control
Panel once the installation process is finished.
Q.4Write a script to echo the following to the browser, using the variable you created:
“What goes around, comes around.”

Code:

<?php

$s1 = "What goes around, comes around";

echo $s1;

?>

Output:
Q.5 Write a PHP Script to calculate the area and circumference of circle.

Code:

<?php

$r = 5;

$ar_circle = 3.14 * $r * $r;

echo "Area of Circle = $ar_circle";

echo "<br>";

$cur_circle = 2 * 3.14 * $r;

echo "Circumference of Circle = $cur_circle";

?>

Output:
Q.6 Write a script to reproduce the output below. Manipulate only one variable using
simple and using no simple arithmetic operators (assignment operator s) to produce the
values given in the statements. In the script each statement ends with "Value is now
$variable."

Value is now 8.
Add 2. Value is now 10.
Subtract 4. Value is now 6.
Multiply by 5. Value is now 30.
Divide by 3. Value is now 10.
Increment value by one. Value is now 11.
Decrement value by one. Value is now 10.

Code:

<?php

$x=8;

echo "Value is now " . $x . "<br>";

$x += 2;

echo "Value is now " . $x . "<br>";

$x -= 4;

echo "Value is now " . $x . "<br>";

$x *= 5;

echo "Value is now " . $x . "<br>";

$x /= 3;

echo "Value is now " . $x . "<br>";

$x = ++$x;

echo "Value is now " . $x . "<br>";

$x = --$x;

echo "Value is now " . $x . "<br>";

?>

Output:
Q.7 Write a script using one variable “$whatisit” to print the following to the browser.
Your echo statements may include no words except “Value is”.

Value is string.
Value is double.
Value is boolean.
Value is integer.
Value is NULL.

Code:

<?php

$num = "whatisit";

var_dump($num);

settype($num, "string");

echo "string value ".$num;

echo "<br>";

settype($num, "double");

echo "double value ".$num;

echo "<br>";

settype($num, "integer");

echo "integer value ",$num;

echo "<br>";

settype($num, "boolean");

echo "boolean value ".$num;

?>
Output:
Q.8 Write a PHP scripts to differentiate the print and echo command.

Code:
<?php

echo "<h1>hello","World","How are You</h1>";


echo "<br>";
print "<h1>hello","World","How are You</h1>";

?>

Output:
Q.9 Write a script to display implicit casting and explicit casting.

Code:
<?php
$x = 2;
$y = 4;

var_dump($x / $y); // 2/4 = 0.5 (Float)


var_dump($y / $x); // 4/2 = 2 (Int)
$x = 5.35;
$y = (int) $x; // cast $x to integer
var_dump($y);
?>

Output:
Q.10 Write a PHP scripts to differentiate the $ and $$.
Code:
<?php
$x="abc";
$$x=200;
echo$x,"<br>";
echo$abc;
?>

Output:
Q.11 Write a program to calculate Electricity bill in PHP Conditions: For first 50 units –
Rs. 3.50/unit For next 100 units – Rs. 4.00/unit For next 100 units – Rs. 5.20/unit For units
above 250 – Rs. 6.50/unit Hint:-You can use conditional statements.

Code:

<html>

<head>

<title>Electricity Bill</title>

</head>

<body>

<center>

<h1>Electricity Bill Calculator</h1>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">

<input type="text" name="unit">

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

</form>

</center>

<?php

if(isset($_POST['submit'])){

$unit = $_POST['unit'];

if($unit <= 50){

$bill = $unit * 3.50;


echo "<center><h2>".$bill."</h2></center>";

}elseif($unit > 50 && $unit <= 100){

$bill = $unit * 4.00;

echo "<center><h2>".$bill."</h2></center>";

}elseif($unit > 100 && $unit <= 200){

$bill = $unit * 5.20;

echo "<center><h2>".$bill."</h2></center>";

}else{

$bill = $unit * 6.50;

echo "<center><h2>".$bill."</h2></center>";

?>

</body>

</html>
Output:
Q.12 Write a PHP script using nested for loop that creates a chess board

Code:

Q.13 Write a PHP program to find three numbers from an array such that the sum of three
consecutive numbers equal to zero

Code:

Q.14 Create an index array with value red, green, orange, blue, pink, white and black,
Count the total array and display all values of array using for loop.
Code:
<?php
$color=array("red","green","orange", "blue", "pink", "white","black");
$count=0;
for($i=0;$i<=6;$i++)
{
$count=$i+1;
echo "<br>" .$color[$i];
}
echo "The total number of elements in array are:" .$count;
?>

Output:
Q. 15 Create an Associative array with value fruits, veggie, dry-fruits and Count the total
array and display all values of array using for each loop.

Code:

<?php
$arr=array("fruits"=>"1","veggie"=>2,"dry-fruits"=>"3");
echo "Size of Array is:".sizeof($arr);
echo "<br>";
foreach($arr as $key=> $value)
{
echo "Key=" . $key .",Value=" .$value;
echo "<br>";
}
?>

Output:
Q.16 Create an Multidimensional Array and Display the array with index and values using
pre tag.

Code:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
/* Multidimensional 2D array for 4 books and each book having a different array containing
book name, cost and type. */
$books = array(
array("Fiction ", "Action and Adventure ", 800),
array("Fiction ", "Anthology ", 1000),
array("Non- Fiction ", "Biography ", 600),
array("Non- Fiction ", "Cook Book ", 900)
);
echo '<pre>',print_r($books,1),'</pre>';

echo "<br>";

?>
</body>
</html>
Output:
Q.17 Write a PHP script to sort the following associative array :
array("Sophia"=>"31","Jacob"=>"41","William"=>"39","Ramesh"=>"40") in

a) ascending order sort by value

b) ascending order sort by Key

c) descending order sorting by Value

d) descending order sorting by Key

Code:

<?php

echo "Associative array : Ascending order sort by value";

$array2=array("Sophia"=>"31","Jacob"=>"41","William"=>"39","Ramesh"=>"40");

asort($array2);

foreach($array2 as $y=>$y_value)

echo "Age of ".$y." is : ".$y_value."";

echo "<br>Associative array : Ascending order sort by Key";

$array3=array("Sophia"=>"31","Jacob"=>"41","William"=>"39","Ramesh"=>"40");

ksort($array3);

foreach($array3 as $y=>$y_value)

echo "Age of ".$y." is : ".$y_value."";

echo "<br>Associative array : Descending order sorting by Value";

$age=array("Sophia"=>"31","Jacob"=>"41","William"=>"39","Ramesh"=>"40");

arsort($age);
foreach($age as $y=>$y_value)

echo "Age of ".$y." is : ".$y_value."";

echo "<br>Associative array : Descending order sorting by Key";

$array4=array("Sophia"=>"31","Jacob"=>"41","William"=>"39","Ramesh"=>"40");

krsort($array4);

foreach($array4 as $y=>$y_value)

echo "Age of ".$y." is : ".$y_value."";

?>

Output:
Q.18 WAP to swap two values (call by reference).

Code:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<html>
<body>
<?php
function f1(&$a) // here $a is a formal parameter
{
$a.="Year";
}
$b="Happy new ";
f1($b);
echo $b;
?>
</body>
</html>
</body>
</html>

Output:
Q.19 WAP to create a php form according to the given format

Code:

<html>
<head><title>Login Form</title></head>
<body>
<form method="POST" action="eg.php">
<p>PHP HTML Form Input Example</p>

Enter Your Full Name : <input type="text" name="name" /><br />


Enter Your Age : <input type="text" name="age" /><br />
<input type="Submit" name="Submit" />
</form>
</body>
</html>
eg.php :<?Php
$name=$_POST['name'];
$age=$_POST['age'];
echo "$name <br>";
echo "$age";
?>

Output:
Q.20 Design a form given below with validation and error message in PHP

Code:
Q.21 Write a PHP Script to demonstrate the file handling in
php(fopen,fclose,fread,fwrite,file length)

Code:

<?php

$myfile = fopen("text.txt", "a+") or die("Unable to open file!");

echo fread($myfile,filesize("text.txt"));

$filesize = filesize("text.txt");

$txt = "Suman Mam\n";

fwrite($myfile, $txt);

echo fread($myfile,filesize("text.txt"));

echo $filesize;

fclose($myfile);

?>

Output:
Q.22 Write a program to upload a file.

Code:

<html>

<head>

<title>File Upload</title>

</head>

<body>

<center>

<h1>File upload</h1>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"


enctype="multipart/form-data">

<input type="file" name="fileToUpload">

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

</form>

</center>

</body>

</html>

<?php

$target_dir = "uploads/";

$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);

$uploadOk = 1;

$imageFileType = strtolower(pathinfo($target_file, PATHINFO_EXTENSION));


// Check if image file is a actual image or fake image

if (isset($_POST["submit"])) {

$check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);

if ($check !== false) {

echo "File is an image - " . $check["mime"] . ".";

$uploadOk = 1;

} else {

echo "File is not an image.";

$uploadOk = 0;

?>
Output:
Q.23 Write a program to store the current date and time in a cookie and display the last
visited date and time on the web page.

Code:

<html>

<body >

<h2> Last visited time </h2>

<br>

<?php

$inTwoMonths = 60 * 60 * 24 * 60 + time();

setcookie('lastVisit', date("G:i - m/d/y"), $inTwoMonths);

if(isset($_COOKIE['lastVisit']))

$visit = $_COOKIE['lastVisit'];

echo "Your last visit was - ". $visit;

else

echo "You've got some stale cookies!";

?>

</body>

</html>
Output:
24. Write a program to store page views counting session to increment the count on each
refresh and to show the count on the page.

Code:

<?php

session_start();

if(isset($_SESSION['count']))

$_SESSION['count'] = $_SESSION['count']+1;

else

$_SESSION['count']=1;

echo"views = ".$_SESSION['count'];

?>

Output:
Q.25 Write and explain the steps to create a database, table, select query using
PhpMyadmin.

Create database

Step 1:Start your XAMPP server and crick on admin of MySQL.

Step 2:Creating a new database


Create Table

creating a new table specify your table name .And click create.
Q.26 Write a PHP program to

 create a connection
 create a database and
 create a table

Code:

<?php

$servername = "localhost";

$username = "root";

$password = "";

$conn = new mysqli($servername, $username, $password);

if ($conn->connect_error) {

die("Connection failed: " . $conn->connect_error);

} else

echo "connection established<br>";

$sql = "CREATE DATABASE testdb";

if ($conn->query($sql) === TRUE) {

echo "Database created successfully<br>";

} else {

echo "Error creating database: " . $conn->error;

$dbname="testdb";

$con = new mysqli($servername, $username, $password,$dbname);

$sql = "CREATE TABLE test (

id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,

firstnameVARCHAR(30) NOT NULL,


lastnameVARCHAR(30) NOT NULL,

email VARCHAR(50)

)";

if ($con->query($sql) === TRUE) {

echo "Table test created successfully<br>";

} else {

echo "Error creating table: " . $conn->error;

$conn->close();

?>

Output:
Q.28 Write a PHP program to insert record into a table

Code:

<?php

$servername = "localhost";

$username = "root";

$password = "";

$dbname = "test";

$conn = new mysqli($servername, $username, $password, $dbname);

if ($conn->connect_error) {

die("Connection failed: " . $conn->connect_error);

$sql="insert into record values('kshitiz','[email protected]')";

if(mysqli_query($conn,$sql))

echo "Records inserted:<br>";

$fetch = "select * from record";

$result = mysqli_query($conn, $fetch);

while ($row = mysqli_fetch_assoc($result)) {

echo"name: ".$row['name']." ,Email: ".$row['email']."<br>";

?>
Output:
Q.29 Write a PHP program to select data and show into table format

Code:

<?php

$servername = "localhost";

$username = "root";

$password = "";

$dbname = "test";

$conn = new mysqli($servername, $username, $password, $dbname);

if ($conn->connect_error) {

die("Connection failed: " . $conn->connect_error);

$fetch = "select * from record";

$result = mysqli_query($conn, $fetch);

echo"<table border='3'>";

echo"<tr><td>Name</td><td>Email</td></tr>";

while ($row = mysqli_fetch_assoc($result)) {

echo"<tr><td>".$row['name']."</td><td>".$row['email']."</td></tr>";

echo"</table>";

?>
Output:
Q.30 Create a student Registration in PHP and Save and Display the student Records.

Code:

<html>

<head>

<title>Student Registration Form</title>

<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"
integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSU
nQlmh/jp3" crossorigin="anonymous"></script>

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"
integrity="sha384-
mQ93GR66B00ZXjt0YO5KlohRA5SY2XofN4zfuZxLkoj1gXtW8ANNCe9d5Y3eG5eD"
crossorigin="anonymous"></script>

<style type="text/css">

body{

background-color: #800000;

color: white;

.form-control{

margin-left: 50px;

</style>

</head>

<body>

<div class="container">

<center><h1>Student Registration Form</h1></center>

<form class="form-control" action="connection.php" method="post">

<label for="name">Name:</label>
<input type="text" name="name" required><br><br>

<label for="dob">D.O.B:</label>

<input type="date" name="dob" required><br><br>

<label for="sex">Sex:</label>

<input type="radio" name="sex" value="male">Male

<input type="radio" name="sex" value="female">Female<br><br>

<label for="email">Email:</label>

<input type="email" name="email" required><br><br>

<label for="address">Address:</label>

<input type="text" name="address" required><br><br>

<label for="school">School:</label>

<select name="school" required>

<option value="ABCSchool">ABC School</option>

<option value="DEFSchool">DEF School</option>

<option value="GHISchool">GHI School</option>

</select><br><br>

<label for="department">Department:</label>

<select name="department" required>

<option value="ABCdpt">ABC Department</option>

<option value="DEFdpt">DEF Department</option>

<option value="GHIdpt">GHI Department</option>

</select><br><br>

<label for="course">Courses:</label>

<select name="course" required>

<option value="BCA">BCA</option>
<option value="BBA">BBA</option>

<option value="BCom">B.Com</option>

</select><br><br>

<label for="mobile">Mobil No</label>

<input type="text" name="mobile" required><br><br>

<input type="submit" name="reset" value="Reset">

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

</form>

</div>

</body>

</html>
Output:

You might also like