Professional Documents
Culture Documents
Samarth Polytechnic, Belhe: Department of Computer Engineering
Samarth Polytechnic, Belhe: Department of Computer Engineering
Subject: Web Based application development using PHP. Subject code: 22619
Experiment No: 11
Theory:
1.0 Title:
Design a web page using following form controls: a. List box, b. Combo box, c. Hidden field box
In this practical we will learn how to design a web page using different controls.
Basic Knowledge: Apply knowledge of basic mathematics, sciences and basic engineering to solve the
computer group related problem.
Discipline Knowledge: Apply computer programming knowledge to solve the computer group related
problems.
Experiments and practices: Plan to perform experiments and practices to use the result to solve the
computer group related problems.
Engineering tools: Apply relevant Computer programming technologies and tools with an understanding
of the limitations.
Individual and Teamwork: Function effectively as a leader and the team member in
diverse/multidisciplinary teams.
Communication: Communicate effectively in oral and written form.
4.0 Apparatus:
a) List box:
A text input field allows a user to enter a single line of text.
Program-
<html>
<head>
<title>List Box</title>
</head>
<body>
<form action="" method="post">
<select name="foods[]" size="3">
<option value="Tomatoes">Tomatoes</option>
<option value="Cucumbers">Cucumbers</option>
<option value="Celery">Celery</option>
</select><br>
<input type="submit" name="submit" value="Submit"/>
</form>
<?php
$c= $_POST['foods'];
if(isset($c))
{
echo 'You have chosen ';
foreach($c as $key => $value)
{
echo $value;
}
}
else
{
echo "You haven't selected any foods";
}
?>
</body>
</html>
Output-
b) Combo box:
Radio buttons let a user select only one of a limited number of choices:
Program-
<html>
<head>
<title>Combo Box</title>
</head>
<body>
<form action="" method="post">
<select name="foods[]">
<option value="Mango">Mango</option>
<option value="Banana">Banana</option>
<option value="Watermelon">Watermelon</option>
<option value="Grapes">Grapes</option>
</select><br>
<input type="submit" name="submit" value="Submit"/>
</form>
<?php
$c= $_POST['foods'];
if(isset($c))
{
echo 'You have chosen ';
foreach($c as $key => $value)
{
echo $value;
}
}
else
{
echo "You haven't selected any fruit";
}
?>
</body>
</html>
Output-
Output-