DWPD Practical
DWPD Practical
DWPD Practical
PRACTICAL – 1
AIM: As per your activity prepare a static web page using as many as
possible HTML tags must use image and anchor tag (minimum 10).
INPUT:-
<html>
<head>
<title>Practical-1</title>
</head>
<body bgcolor="black">
<img src="C:\Users\jeelp\Downloads\taj.jpeg" width="1345"
height="500">
<center>
<table border="0" cellspacing="30" cellpadding="5"
bordercolor="black">
<tr style=font-size:30px>
<td><a href="C:\Users\jeelp\OneDrive\Documents\DWPD\About
us.html">About us</a></td></h1>
<td><a href="C:\Users\jeelp\OneDrive\Documents\DWPD\Contact
us.html">Contact us</a></p></td>
<td><a href="C:\Users\jeelp\OneDrive\Documents\DWPD\
blog.html">Blog</a></p></td>
</tr>
</table>
</center>
</body>
</html>
About us page:-
3350702 DWPD Page | 1
206150307007 DCE-A SUHANI VAISHNAV
<html>
<head>
<title>About us</title>
</head>
<body background="C:\Users\jeelp\Downloads\hotel.jpg"
background-repeat: no-repeat>
<center><p style="color:black;font-size:50px;">About
Taj</p></center>
<center><p style="color:black;font-size:30px;">A curation of
authentic living palaces, landmark hotels, resorts and safaris, Taj is
the hallmark of iconic hospitality across the globe. The brand is
recognised for its warm and intuitive service and is the undisputed
leader in Indian hospitality.</p></center>
<img src="C:\Users\jeelp\Downloads\1.jpg"
width="300"height="300"style="padding:0px 0px;float:left"></p>
<img src="C:\Users\jeelp\Downloads\2.jpg" width="300"
height="300" style="padding:0px 200px;vertical-align:middle">
<img src="C:\Users\jeelp\Downloads\3.jpg" width="300"
height="300" style="padding:0px 0px;float:right">
</body>
</html>
Contact us page:-
<html>
<head>
<title>Contact us</title>
</head>
<body background="C:\Users\jeelp\Downloads\hotel.jpg"
background-repeat: no-repeat;>
<center>
<p style="color:black;font-size:50px;">Contact Us</p>
<p>On behalf of The Indian Hotels Company Limited (IHCL), we
would like to assure you that the health and safety of our guests and
3350702 DWPD Page | 2
206150307007 DCE-A SUHANI VAISHNAV
<tr>
<td align="center" style="color:black">Egypt Toll Free</td>
<td align="center">8000000485</td>
</tr>
<tr>
<td align="center" style="color:black">United Arab Emirates (UAE)
Toll Free:</td>
<td align="center">800-035-702-467</td>
</tr>
</center>
</body>
</html>
Blog page:-
<html>
<head>
<title>Blog</title>
</head>
<body background="C:\Users\jeelp\Downloads\hotel.jpg"
background-repeat: no-repeat;>
<center><p style="color:orange;font-size:60px;">Blog</p></center>
<center><img src="C:\Users\jeelp\Downloads\t.jpeg"
width="300"height="300" style=padding:0px 0px;></center>
<center><p style="color:black;font-size:20px;bg color="white"">The
Taj Mahal Palace Hotel in Mumbai (Bombay) reminds me of the
Titanic. It is huge, impressive, luxurious, Edwardian, world famous
and it suffered an unbelievable tragedy. The difference is, of course,
that the Titanic rests at the bottom of the ocean and the Taj Mahal
Place Hotel has risen like a phoenix from the ashes. Partially
destroyed during the Mumbai attacks of November 2008, the hotel
has been under construction for the last two years. It is now
completely open.
There are few hotels in the world that equal the iconic status of the
Taj Mahal Palace Hotel. Legend has it that Indian industrialist J.R.D.
Tata built it because he wasn’t allowed in the city’s leading British
hotel. Since opening in 1903, the Taj has held both the pre-eminent
social and geographical position in the city. When terrorists attacked
Mumbai in November 2008, they headed straight for the Taj Hotel –
knowing they were hitting a powerful symbol of Indian pride. The
world watched spellbound as flames leaped from the windows of the
grand building during the three-day siege. </center>
</body>
</html>
OUTPUT:-
PRACTICAL – 2
AIM: Display video & audio using <EMBED> tag on a webpage.
INPUT:-
<html>
<head>
<title>practical-2</title>
</head>
<body bgcolor="orange">
<center>
<h1>Embedded Tag</h1>
<embed type="audio/mp3" src="C:\Users\jeelp\Downloads\Spring
Day.mp3" width="400" height="300">
<embed type="video/mp4" src="C:\Users\jeelp\Videos\K.G.F
Chapter 2 (Hindi) 2022.mp4" width="400" height="300">
</center>
</body>
</html>
OUTPUT:-
PRACTICAL – 3
AIM: Design a Feedback form to obtain feedback using HTML tags.
(Faculty Feedback)
INPUT:-
<html>
<head>
<title>FEEDBACK FORM</title>
<style>
body {
background-repeat: no-repeat;
background-size: 100% 100%;
background-image:url("5.jpg");
}
</style>
</head>
<body >
<center>
<form action="thank.html">
<h1> HOTEL FEEDBACK FORM</h1>
<table align="center" cellpadding = "5" cellspacing="5">
<tr>
<td>Name</td>
<td><input type="text"name="fname" placeholder="Name"
required>
<td>
</tr>
<tr>
<td>Room no</td>
<td><input type="number" name="number" placeholder="Room no"
required>
3350702 DWPD Page | 10
206150307007 DCE-A SUHANI VAISHNAV
<td>
</tr>
<tr>
<td>Contact no</td>
<td><input type="number" name="number" placeholder="Contact
No">
<td>
</tr>
<tr>
<td>E-mail ID</td>
<td><input type="email" name="ename" placeholder="E-mail ID">
<td>
</tr>
<tr>
<td>Check in date</td>
<td><input type="date" name="date" placeholder="Check in date"
required>
</td>
</tr>
<tr>
<td>Check out date</td>
<td><input type="date" name="date" placeholder="Check in date"
required>
</td>
</tr>
<tr>
<td>Front office service</td>
<td>
<input type="radio" name="Good" value="Good">Good
<input type="radio" name="Very Good" value="Very Good">Very
Good
<input type="radio" name="Average" value="Average">Average
<input type="radio" name="Excellent" value="Excellent">Excellent
3350702 DWPD Page | 11
206150307007 DCE-A SUHANI VAISHNAV
</td>
</tr>
<tr>
<td>House keeping service</td>
<td>
<input type="radio" name="Good" value="Good">Good
<input type="radio" name="Very Good" value="Very Good">Very
Good
<input type="radio" name="Average" value="Average">Average
<input type="radio" name="Excellent" value="Excellent">Excellent
</td>
</tr>
<tr>
<td>Food & Beverage service</td>
<td>
<input type="radio" name="Good" value="Good">Good
<input type="radio" name="Very Good" value="Very Good">Very
Good
<input type="radio" name="Average" value="Average">Average
<input type="radio" name="Excellent" value="Excellent">Excellent
</td>
</tr>
<tr>
<td>Staff service</td>
<td>
<input type="radio" name="Good" value="Good">Good
<input type="radio" name="Very Good"value="Very Good">Very
Good
<input type="radio" name="Average" value="Average">Average
<input type="radio" name="Excellent" value="Excellent">Excellent
</td>
</tr>
<tr>
3350702 DWPD Page | 12
206150307007 DCE-A SUHANI VAISHNAV
<td>Comment or suggestion</td>
<td>
<textarea rows="5" cols="30"></textarea>
</td>
</tr>
<tr align="center">
<td>
<input type="Submit" name="Submit" value="Submit">
<input type="Reset" name="cancel" value="cancel">
</td>
</tr>
</table>
</center>
</form>
</body>
</html>
OUTPUT:-
PRACTICAL – 4
AIM: Divide your web page in three section using tag and create
menu in first section using List tags.
INPUT:-
<html>
<head>
<title>Practical-4</title>
<style>
header {
background-color: #87CEEB;
text-align: center;
font-size: 30px;
color: black;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height:20%
}
.left {
position: absolute;
top: 20%;
left: 0%;
margin-right: -50%;
width: 15%;
height: 80%;
background:#87CEEB;
}
ul.a {
list-style-type: disc;
3350702 DWPD Page | 16
206150307007 DCE-A SUHANI VAISHNAV
padding: 5px,15px;
}
.right {
float: left;
position: absolute;
top: 20%;
left: 15%;
height: 80%;
width: 85%;
background-color: pink;
height: 500px; /* only for demonstration, should be removed */
}
section::after {
content: "";
display: table;
clear: both;
}
@media (max-width: 600px) {
nav, article {
width: 100%;
height: auto;
}
}
h2{
font-family: Sans-serif;
font-size: 24px;
font-style: normal;
font-weight: bold;
color: blue;
text-align: center;
text-decoration: underline
}
table{
3350702 DWPD Page | 17
206150307007 DCE-A SUHANI VAISHNAV
font-family: verdana;
color:white;
font-size: 16px;
font-style: normal;
font-weight: bold;
background: linear-gradient(to bottom, #33ccff 0%, #ff99cc 100%);
border-collapse: collapse;
border: 4px solid #000000;
border-style: dashed;
}
table.inner{
border: 0px
}
input[type=text], input[type=email], input[type=number]{
width: 50%;
padding: 6px 12px;
margin: 5px 0;
box-sizing: border-box;
}
input[type=submit], input[type=reset]{
width: 15%;
margin: 5px 0;
box-sizing: border-box;
}
</style>
</head>
<body>
<header>
<h1>Registration Form</h1>
</header>
<section>
<div class="left">
<ul class="a">
<li><a href="#">Registration Form</a></li>
<li><a href="#">Admission Form</a></li>
<li><a href="#">Feedback form</a></li>
<li><a href="#">Login form</a></li>
</ul>
</div>
<div class="right">
<center>
<h3>Registration form</h3>
</center>
<form>
<table align="center" cellpadding = "3">
<!--------------------- First Name ------------------------------------------>
<tr>
<td>First Name</td>
<td><input type="text" name="FirstName" maxlength="50"
placeholder="First Name" />
</td>
</tr>
<!------------------------ Last Name --------------------------------------->
<tr>
<td>Last Name</td>
<td><input type="text" name="LastName" maxlength="50"
placeholder="Last Name"/>
</td>
</tr>
<!-------------------------- Email ID ------------------------------------->
<tr>
<td>Email ID</td>
<td><input type="email" name="EmailID" maxlength="100"
placeholder="email@gmail.com"/></td>
3350702 DWPD Page | 19
206150307007 DCE-A SUHANI VAISHNAV
</tr>
<!-------------------------- Mobile Number
------------------------------------->
<tr>
<td>Mobile Number</td>
<td>
<input type="text" name="MobileNumber" maxlength="10"
placeholder="7842xxxxxx"/>
</td>
</tr>
<!---------------------- Gender ------------------------------------->
<tr>
<td>Gender</td>
<td>
<input type="radio" name="Gender" value="Male" />
Male
<input type="radio" name="Gender" value="Female" />
Female
</td>
</tr>
<!--------------------------Date Of Birth----------------------------------->
<tr>
<td>Date of Birth(DOB)</td>
<td>
<select name="BirthDay" id="Birthday_Day">
<option value="-1">Day:</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
3350702 DWPD Page | 20
206150307007 DCE-A SUHANI VAISHNAV
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
<select name="BirthdayMonth" id="Birthday_Month">
<option value="-1">Month:</option>
<option value="January">Jan(1)</option>
<option value="February">Feb(2)</option>
<option value="March">Mar(3)</option>
<option value="April">Apr(4)</option>
<option value="May">May(5)</option>
<option value="June">Jun(6)</option>
3350702 DWPD Page | 21
206150307007 DCE-A SUHANI VAISHNAV
<option value="July">Jul(7)</option>
<option value="August">Aug(8)</option>
<option value="September">Sep(9)</option>
<option value="October">Oct(10)</option>
<option value="November">Nov(11)</option>
<option value="December">Dec(12)</option>
</select>
<select name="BirthdayYear" id="Birthday_Year">
<option value="-1">Year:</option>
<option value="2019">2019</option>
<option value="2018">2018</option>
<option value="2017">2017</option>
<option value="2016">2016</option>
<option value="2015">2015</option>
<option value="2014">2014</option>
<option value="2013">2013</option>
<option value="2012">2012</option>
<option value="2011">2011</option>
<option value="2010">2010</option>
<option value="2009">2009</option>
<option value="2008">2008</option>
<option value="2007">2007</option>
<option value="2006">2006</option>
<option value="2005">2005</option>
<option value="2004">2004</option>
<option value="2003">2003</option>
<option value="2002">2002</option>
<option value="2001">2001</option>
<option value="2000">2000</option>
<option value="1999">1999</option>
<option value="1998">1998</option>
<option value="1997">1997</option>
<option value="1996">1996</option>
3350702 DWPD Page | 22
206150307007 DCE-A SUHANI VAISHNAV
<option value="1995">1995</option>
<option value="1994">1994</option>
<option value="1993">1993</option>
<option value="1992">1992</option>
<option value="1991">1991</option>
<option value="1990">1990</option>
<option value="1989">1989</option>
<option value="1988">1988</option>
<option value="1987">1987</option>
<option value="1986">1986</option>
<option value="1985">1985</option>
<option value="1984">1984</option>
<option value="1983">1983</option>
<option value="1982">1982</option>
<option value="1981">1981</option>
<option value="1980">1980</option>
</select>
</td>
</tr>
<!------------------------- Address ---------------------------------->
<tr>
<td>Address<br /><br /><br /></td>
<td><textarea name="Address" rows="5"
cols="30"></textarea></td>
</tr>
<!-------------------------- City ------------------------------------->
<tr>
<td>City</td>
<td><input type="text" name="City" maxlength="50"
placeholder="Bangalore"/>
</td>
</tr>
<!----------------------- Submit and Reset ------------------------------->
3350702 DWPD Page | 23
206150307007 DCE-A SUHANI VAISHNAV
<tr>
<td colspan="2" align="center">
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</td>
</tr>
</div>
</section>
</table>
</form>
</body>
</html>
OUTPUT:-
PRACTICAL – 5
AIM: Build Google Homepage with the help of HTML 5.0 tags.
INPUT:-
<html>
<head>
<title>Google</title>
</head>
<body>
<style>
body {
background-repeat: no-repeat;
background-size: 100% 100%;
background-image:url("6.jpg");
}
html {
height: 100%;
font-size: 100%
}
body {
font: 13px arial;
sans-serif;
}
ul {
list-style: none;
padding: 0px;
line-height: 0px;
}
li {
display: inline-block;
padding: 5px 7px;
3350702 DWPD Page | 26
206150307007 DCE-A SUHANI VAISHNAV
vertical-align: middle;
}
nav, footer {
padding: 4px 20px;
}
/* ------- Top Nav ------- */
nav img {
list-style: none;
color: #000;
opacity: 0.85;
}
nav a {
text-decoration: none;
color: #000;
opacity: 0.75;
}
nav ul li a:hover {
text-decoration-line: underline;
opacity: 0.65;
}
.r_nav {
float: right;
position: relative;
padding-top: 0px;
padding-right: 8px;
}
.apps {
width: 16px;
height: 16px;
margin-top: -2px;
padding-right: 9px;
opacity: 0.75;
}
3350702 DWPD Page | 27
206150307007 DCE-A SUHANI VAISHNAV
.apps:hover {
opacity: 1;
}
.sign_in {
border: 1px solid #4285f4;
outline: none;
background: #4285f4;
display: inline-block;
line-height: 28px;
padding: 0 12px;
border-radius: 2px;
}
.sign_in a {
font-weight: bold;
color: #fff;
opacity: 1;
text-decoration: none;
}
.sign_in a:hover {
opacity: 1;
text-decoration: none;
}
.sign_in:hover {
opacity: 1;
box-shadow: 0 1.5px 0 0 #e4e4e4;
}
/* ------- Center Conte ------- */
span{
font-size:130px;
position:relative;
left: 100px;
top: 34px;
}
3350702 DWPD Page | 28
206150307007 DCE-A SUHANI VAISHNAV
body{
text-align:center;
}
googleHome{
margin-top:50,50,50,50}
}
.cntr_pg {
position: absolute;
top: 40%;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%)
}
.form {
display: block;
margin: auto;
}
.search_bar {
border-radius: 40px;
width: 585px;
margin: auto;
height: 39px;
border: .7px solid #E4E4E4;
background-color: #fff;
box-shadow:0px 1px 4px #E4E4E4;
margin-bottom: 20px;
outline: none;
text-indent: 15px;
}
.search_bar:hover, .search_bar:active {
padding-bottom: 2px;
padding-top: 1px;
margin-top: -1px;
width: 585px;
box-shadow:0px 3px 8px #E4E4E4;
outline: none;
}
.search_button {
width: 25px;
height: 25px;
position: relative;
left: -260px;
top: 34px;
}
.mic {
width: 14px;
height: 20px;
position: relative;
left: 260px;
top: 32px;
}
.submit_buttons {
display: inline-block;
height: 36px;
cursor: pointer;
line-height: 27px;
background-color: #f2f2f2;
border: 1px solid #f2f2f2;
border-radius: 2px;
color: #757575;
cursor: default;
font-family: arial,sans-serif;
font-size: 13px;
font-weight: bold;
3350702 DWPD Page | 30
206150307007 DCE-A SUHANI VAISHNAV
text-decoration: none;
opacity: 0.75;
font-size: 14px;
font-family: arial,sans-serif;
color: #202124;
}
footer a:hover {
text-decoration-line: underline;
}
</style>
<body>
<nav>
<ul class="r_nav">
<li><a href="#">Gmail</a></li>
<li><a href="#">Images</a></li>
<li><a href="#"><img class="apps"
src="https://thumb.ibb.co/gykLCw/grid_menu.png"</a></li>
<li class="sign_in"><a href="#">Sign in</a></li>
</ul>
</nav>
<div class="googleHome">
<p>
<span style='color: blue'>G</span>
<span style='color: red'>o</span>
<span style='color: yellow'>o</span>
<span style='color: blue'>g</span>
<span style='color: green'>l</span>
<span style='color: red'>e</span>
</p>
<section class="cntr_pg">
<br>
<br>
<img class="search_button" src="7.png" alt="" />
3350702 DWPD Page | 32
206150307007 DCE-A SUHANI VAISHNAV
<img class="mic"
src="https://upload.wikimedia.org/wikipedia/commons/2/22/Google_
microphone_logo.png" alt="" />
<form action="#" method="#" name="searchquery">
<input type="text" name="Search Google or type a URL"
class="search_bar" placeholder=" Search Google or type a
URL"></input>
<div class="search_buttons">
<input class="submit_buttons" type="submit" value="Google
Search" name="submit">
<input class="submit_buttons" type="submit" value="I'm
Feeling Lucky" name="feelinglucky"></input>
</div>
</form>
</section>
<footer>
<ul class="l_ftr">
<li><a href="#">About</a></li>
<li><a href="#">Advertising</a></li>
<li><a href="#">Business</a></li>
<li><a href="#">How search works</a></li>
</ul>
<ul class="r_ftr">
<li><a href="#">Privacy</a></li>
<li><a href="#">Terms</a></li>
<li><a href="#">Settings</a></li>
</ul>
</footer>
</body>
</html>
OUTPUT:-
3350702 DWPD Page | 33
206150307007 DCE-A SUHANI VAISHNAV
PRACTICAL – 6
AIM: Apply formatting style to the different elements in a webpage
using CSS E.g., GTU Website.
INPUT:-
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="insta.css">
</head>
<title>practical-6</title>
<body>
<div class="right">
<img src="C:\Users\jeelp\OneDrive\Documents\DWPD\8.png"
height="600" width="450">
</div>
<div class="left">
<div class="top"><br>
<center><img src="C:\Users\jeelp\OneDrive\Documents\DWPD\
9.png"></center>
</div>
<br>
<form>
<center>
<div class="container">
<label for="uname"><b>Username</b></label>
<br>
<input type="text" placeholder="Enter Username" name="uname"
required>
<br>
<label for="psw"><b>Password</b></label>
3350702 DWPD Page | 35
206150307007 DCE-A SUHANI VAISHNAV
<br>
<input type="password" placeholder="Enter Password"
name="psw" required>
<button type="submit">Login</button>
<label>
<br>
<input type="checkbox" checked="checked" name="remember">
Remember me
</label>
</div>
</div>
</center>
</form>
</div>
</body>
</html>
CSS.html:-
<html>
<head>
<style>
.left {
position: absolute;
top: 15%;
left: 55%;
margin-right: 0%;
width: 100%;
height: 70%;
}
input[type=text], input[type=email], input[type=number]{
width: 0%;
padding: 6px 12px;
margin: 5px 0;
box-sizing: border-box;
border-radius:12px 12px 12px 12px;
}
input[type=submit], input[type=reset]{
width: 0%;
margin: 5px 0;
box-sizing: border-box;
}
h1:hover
{
-webkit-transform:rotate(-50deg);
}
.right {
float: left;
position: absolute;
top: 5%;
left: 15%;
}
body {
font-family: Arial, Helvetica, sans-serif;
transition: -webkit-transform 3s ease-in 2s;
-webkit-animation:changeColor 10s;
}
@-webkit-keyframes changeColor
{
3350702 DWPD Page | 37
206150307007 DCE-A SUHANI VAISHNAV
0%
{
background-color:white;
}
50%
{
background-color:violet;
}
100%
{
background-color:yellow;
}
}
form {
opacity:0.9;
border: 3px dashed grey;
height:79%;
width:30%;
-webkit-transform:translate(700px,100px);
box-shadow:10px 10px 5px grey;
background-color: white;
}
input[type=text], input[type=password] {
width: 80%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
border-radius:12px 12px 12px 12px;
}
button {
3350702 DWPD Page | 38
206150307007 DCE-A SUHANI VAISHNAV
background-color: #04AA6D;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 80%;
border-radius:12px 0px 12px 0px;
}
button:hover {
opacity: 0.8;
}
.cancelbtn {
width: auto;
padding: 10px 18px;
background-color: #f44336;
}
.container {
padding: 10px;
}
.cancelbtn {
width: 80%;
}
.top{
height:18%;
width:30.50%;
-webkit-transform:translate(700px,100px);
background:linear-gradient(to bottom right ,violet,yellow);
}
</style>
</head>
</html>
OUTPUT:-
PRACTICAL – 7
AIM: Apply formatting style to the different elements in a webpage
using CSS E.g., GTU Website.
INPUT:-
<html>
<head>
<title>practical-7</title>
<style>
table
{
width:500px;
font-family:Times New roman;
background:orange;
font-size:25px;
}
table,td
{
border:0px solid;
padding:10px;
border-collapse:collapse;
}
</style>
</head>
<body>
<center>
<table>
<?php
echo "<h2>MY PERSONAL INFORMATION</h2>";
echo "<tr>";
OUTPUT:-
PRACTICAL – 8
AIM: Use different PHP operators like arithmetic, logical, comparison,
etc.
INPUT:-
<html>
<head>
<style>
table
{
width:1200px;
height:550px;
font-family:Times New roman;
background:linear-gradient(to bottom right ,violet,yellow);
font-size:16px;
border-spacing: 5px;
}
th, td {
padding-top: 10px;
padding-bottom: 20px;
padding-left: 30px;
padding-right: 40px;
border:0px solid;
border-collapse:collapse;
}
</style>
</head>
<body>
<center>
<b><h1>OPERATORS</h1></b>
3350702 DWPD Page | 44
206150307007 DCE-A SUHANI VAISHNAV
<table>
<?php
echo "<tr>";
echo "<td>";
echo "<h2>Arithmetic Operators</h2>";
$a=10;
$b=9;
$c=$a+$b;
echo "a=$a <br>";
echo "b=$b <br>";
echo "a+b=:";
echo $c;
$c=$a-$b;
echo "<br>a-b=";
echo $c;
$c=$a*$b;
echo "<br>a*b=";
echo $c;
$c=$a/$b;
echo "<br>a/b=";
echo $c;
$c=$a%$b;
echo "<br>a%b=";
echo $c;
echo "</td>";
echo "<td>";
echo "<h2>Increment/Decerement Operators</h2>";
$a = 10;
echo 'Value of $a is :'.$a;
echo '<br />After Pre-increment value of $a (++$a ) is: '.++$a;
$a = 20;
echo '<br />Value of $a is :'.$a;
echo '<br />After Post-increment value of $a ($a++ ) is: '.$a++;
3350702 DWPD Page | 45
206150307007 DCE-A SUHANI VAISHNAV
$a = 30;
echo '<br />Value of $a is :'.$a;
echo '<br />After Pre-decrement value of $a (--$a ) is: '.--$a;
$a = 40;
echo '<br />Value of $a is :'.$a;
echo '<br />After Post-decrement value of $a ($a-- ) is: '.$a--;
echo "</td>";
echo "<td>";
echo "<h2>Bitwise Operator</h2>";
$x=13;
$y=22;
echo "x=$x <br>";
echo "y=$y <br>";
$z=$x & $y ;
echo "x & y=:$z <br>";
$z=$x | $y;
echo "x | y=:$z <br>";
$z=$x >> 1;
echo "x >> =:$z <br>";
$z=$x << 1;
echo "x << y=:$z <br>";
$z=$x ^ $y;
echo "x ^ y=:$z <br>";
$z=~$x;
echo "~x =:$z <br>";
echo "</td>";
echo "<td>";
echo "<h2>Comparison Operators</h2>";
$a=10;
$b=9;
echo "a=$a <br>";
echo "b=$b <br>";
if($a==$b)
3350702 DWPD Page | 46
206150307007 DCE-A SUHANI VAISHNAV
echo "</td>";
echo "<td>";
echo "<h2>Ternary Operators</h2>";
$a=10;
$b=20;
echo "a = $a <br>";
echo "b = $b <br>";
$c = ($a>$b?"$a is greater":"$b is greater");
echo "c = (a>b?a is greater",":","b is greater)<br>";
echo $c;
echo "</td>";
echo "<td>";
echo "<h2>String concatination Operator</h2>";
echo "a = Hello <br>";
$a = "Hello";
echo "b = world! <br>";
$b = " world!";
echo $a . $b;
echo "</td>";
echo "</tr>";
?>
</table>
</center>
</body>
</html>
OUTPUT:-
PRACTICAL – 9
AIM: Try variables of several datatypes with gettype() & settype() and
Demonstrate the use of Type casting .
INPUT:-
<html>
<head>
<title>practical-7</title>
</head>
<?php
echo"<b><h1>Gettype,Settype,Typecasting</h1></b>";
$a=5;
$b=5.8;
$c="suhani";
$d=true;
$var1=20;
echo gettype($a);
echo "<br>";
settype($a,"String");
echo gettype($a);
echo "<br>";
echo gettype($b);
echo "<br>";
echo gettype($c);
echo "<br>";
echo gettype($d);
echo "<br>";
echo gettype($var1);
$var2var1=(float)$var1;
echo gettype($var2var1);
?>
</html>
OUTPUT:-
PRACTICAL – 10
AIM: Write a PHP script to display Fibonacci Series (15 digits).
INPUT:-
<html>
<body>
<form method="post">
<body>
<form method="post">
<h2>Enter Your Number:</h2>
<input type="text" name="Number" >
<button name="submit">Submit</button>
</form>
</body>
</html>
<?php
if (isset($_POST['submit'])) {
$n=$_POST['Number'];
$number1 = 0;
$number2 = 1;
echo "Fibonacci Series:<br>";
echo $number1.'<br>'.$number2.'<br>';
for($i = 2; $i < $n; $i++){
$number3= $number1 + $number2;
echo $number3.'<br>';
$number1 = $number2;
$number2 = $number3;
}
}
OUTPUT:-
PRACTICAL – 11
AIM: Calculate total marks & display student’s result with
grade using PHP.
INPUT:-
<html>
<head>
<title>gtu result</title>
<style>
form{
border: 2px dotted black;
height:40%;
width:30%;
padding:15px;
font-size:20px;
}
.d1 table tr{
font-size:35px;
padding:20px;
color: #000080;
font-style:sans-serif;
}
.d2 table tr th{
text-align:justify;
padding:5px;
background-color:#EBF5FB;
}
.d3 table{
border-color:lightgrey;
}
<br>
<input type="submit" name="submit" value="Get Result"
style="padding: 10px; font-size:0.5cm;">
</form>
<div class="d1">
<table>
<tr>
<td><img src="logo.png" width="120px"
height="100px"></td>
<td><b>Gujarat Technological University
Ahmedabad</b></td>
</tr>
</table>
</div>
<hr width="900px" height="4px" color="red">
<div class="d2">
<table width="900px">
<tr>
<td><img src="search.png" width="450px"
height="170px"></td>
<td><img src="search result.png" height="170px"
width="450px"></td>
</tr>
</table>
</div>
<hr width="900px" color="grey">
<div class="d3">
<?php
if(isset($_POST['submit']))
$cmts=$_POST['cmts'];
$dwpd=$_POST['dwpd'];
$java=$_POST['java'];
$cns=$_POST['cns'];
3350702 DWPD Page | 56
206150307007 DCE-A SUHANI VAISHNAV
?>
<table width="900px">
<tr>
<th style="width:130px;">SUBJECT CODES</th>
<th style="width:600px;">SUBJECT NAME</th>
<th style="width:130px;">SUBJECT MARKS</th>
<th style="width:130px;">SUBJECT GRADE</th>
</tr>
</table>
</div><br/>
<div class="d5">
<table border=1>
<tr>
<th style="width: 130px;">3350701</th>
<th style="width: 550px;">COMPUTER
MAINTENANCE AND TROUBLE SHOOTING</th>
<th style="width:130px;">
<?php
echo $cmts;
?>
</th>
<th style="width:130px;">
<?php
if($cmts>=85)
{
$f="AA";
}
else if($cmts>=75&&$cmts<=84)
{
$f="AB";
}
else if($cmts>=65&&$cmts<=74)
3350702 DWPD Page | 57
206150307007 DCE-A SUHANI VAISHNAV
{
$f="BB";
}
else if($cmts>=55&&$cmts<=64)
{
$f="BC";
}
else if($cmts>=45&&$cmts<=54)
{
$f="CC";
}
else if($cmts>=40&&$cmts<=44)
{
$f="CD";
}
else if($cmts>=35&&$cmts<=39)
{
$f="DD";
}
else{
$f="FF";
}
?>
<?php
echo $f;
?>
</th>
</tr>
<tr>
<th>3350702</th>
<th>DYNAMIC WEBPAGE DEVLOPMENT</th>
<th>
<?php
3350702 DWPD Page | 58
206150307007 DCE-A SUHANI VAISHNAV
echo $dwpd;
?>
</th>
<th>
<?php
if($dwpd>=85)
{
$f="AA";
}
else if($dwpd>=75&&$dwpd<=84)
{
$f="AB";
}
else if($dwpd>=65&&$dwpd<=74)
{
$f="BB";
}
else if($dwpd>55&&$dwpd<=64)
{
$f="BC";
}
else if($dwpd>=45&&$dwpd<=54)
{
$f="CC";
}
else if($dwpd>=40&&$dwpd<=44)
{
$f="CD";
}
else if($dwpd>=35&&$dwpd<=39)
{
$f="DD";
}
3350702 DWPD Page | 59
206150307007 DCE-A SUHANI VAISHNAV
else{
$f="FF";
}
?>
<?php
echo $f;
?>
</th>
</tr>
<tr>
<th>3350703</th>
<th>JAVA PROGRAMMING</th>
<th>
<?php
echo $java;
?>
</th>
<th>
<?php
if($java>85)
{
$f="AA";
}
else if($java>=75&&$java<=84)
{
$f="AB";
}
else if($java>=65&&$java<=74)
{
$f="BB";
}
else if($java>55&&$java<=64)
{
3350702 DWPD Page | 60
206150307007 DCE-A SUHANI VAISHNAV
$f="BC";
}
else if($java>=45&&$java<=54)
{
$f="CC";
}
else if($java>=40&&$java<=44)
{
$f="CD";
}
else if($java>=35&&$java<=39)
{
$f="DD";
}
else
{
$f="FF";
}
?>
<?php
echo $f;
?>
</th>
</tr>
<tr>
<th>3350704</th>
<th>COMPUTER NETWORK AND SECURITY</th>
<th>
<?php
echo $cns;
?>
</th>
<th>
3350702 DWPD Page | 61
206150307007 DCE-A SUHANI VAISHNAV
<?php
if($cns>=85)
{
$f="AA";
}
else if($cns>=75&&$cns<=84)
{
$f="AB";
}
else if($cns>=65&&$cns<=74)
{
$f="BB";
}
else if($cns>=55&&$cns<=64)
{
$f="BC";
}
else if($cns>=45&&$cns<=54)
{
$f="CC";
}
else if($cns>=40&&$cns<=44)
{
$f="CD";
}
else if($cns>=35&&$cns<=39)
{
$f="DD";
}
else{
$f="FF";
}
?>
3350702 DWPD Page | 62
206150307007 DCE-A SUHANI VAISHNAV
<?php
echo $f;
?>
</th>
</tr>
</table>
</div><br/>
<div class="d4">
<table border=1 width="900px">
<tr>
<th>Current Backlog:0</th>
<th>Total Backlog:0</th>
<th>SPI : 8.39</th>
<th>CPI : 8.13</th>
<th>CGPA : 8.39</th>
</tr>
</table>
</div>
<html>
<h3>
<?php
if($cmts<35 || $dwpd<35 || $java<35 || $cns<35)
{
echo "Oops! You Have Fail This Exam...";
}
?>
</h3>
</html>
<html>
<h2>
<?php
if($cmts>35 || $dwpd>35 || $java>35 || $cns>35)
{
3350702 DWPD Page | 63
206150307007 DCE-A SUHANI VAISHNAV
OUTPUT:-
OUTPUT:-
PRACTICAL – 12
AIM: Display maximum of three given numbers.
INPUT:-
<html>
<head>
<title>practical-12</title>
<style>
form{
border: 2px dotted black;
height:29%;
width:30%;
padding:15px;
background:linear-gradient(to bottom right ,violet,yellow);
}
body{
background:linear-gradient(140deg,#EADEDB 0%,
#BC70A4 50%, #BFD641 75%);
}
</style>
</head>
<body><center>
<h1>Maximum of three numbers</h1>
<form method="post">
<label style="font-size:0.6cm;">Enter
Num1:</label> <input type="text" name="n1"
required><br/>
<br>
<label style="font-size: 0.6cm;">Enter
Num2:</label> <input type="text" name="n2"
required><br/>
<br>
<label style="font-size: 0.6cm;">Enter
Num3:</label> <input type="text" name="n3"
required><br/>
<br>
<input type="submit" name="submit" value="Get maximum"
style="padding: 10px; font-size:0.5cm;">
</form>
</center>
<?php
if(isset($_POST['submit']))
$n1=$_POST['n1'];
$n2=$_POST['n2'];
$n3=$_POST['n3'];
echo "<center>";
echo "<h1>";
echo "OUTPUT:";
if($n1>$n2 &&$n1>$n3)
{
echo "<br>Num1= $n1<br>Num2= $n2<br>Num3=
$n3<br>Maximum : $n1";
}
else if($n2>$n3)
{
echo "<br>Num1= $n1<br>Num2= $n2<br>Num3=
$n3<br>Maximum : $n2";
}
else
echo "<br>Num1= $n1<br>Num2= $n2<br>Num3=
$n3<br>Maximum : $n3";
echo "</h1>";
echo "</center>";
?>
</body>
</html>
OUTPUT:-
PRACTICAL – 13
AIM: Using 2-Dimension array, Perform addition of two 2x2
matrices.
INPUT:-
<html>
<head>
<title>Practical-13</title>
<style>
body
{
font-size:20px;
background:linear-gradient(to right ,#42275a, #734b6d);
}
</style>
</head>
<body>
<center>
<h1>2*2 MATRICES</h1>
<font color="white">
<?php
$a = array(
array(4, 6),
array(3, 9),
);
$b = array(
array(6, 7),
array(9, 2),
);
$row = count($a);
$col = count($a[0]);
echo "First matrix: <br>";
for ($i = 0; $i < $row; $i++)
{
for ($j = 0; $j < $col; $j++)
{
OUTPUT:-
PRACTICAL – 14
AIM: Show the use of associative arrays & execution using
FOR EACH loop statement.
INPUT:-
<html>
<head>
<title>practical-14</title>
</head>
<style>
body {
font-size:20px;
background:linear-gradient(to right ,#000428 , #004e92);
color:white;
}
h2{
font-size:40px
}
table
{
width:280px;
font-family:Times New roman;
background:linear-gradient(to right ,#43cea2 , #185a9d);
font-size:25px;
color:black;
}
table,td
{
border:1px solid;
padding:10px;
border-collapse:collapse;
}
</style>
<body>
<center>
<table>
<?php
echo "<h1>";
echo "Associative array\n";
echo "</h1>";
echo "<h2>";
echo "Kdrama\n";
echo "</h2>";
echo "<td>";
$kdrama = array
(
"Name" => "Again my life",
"Language" => "Korean",
"Genres" => "Action, Fantasy",
"Number of episodes" => "16",
"Rating" => "9.4/10"
);
// Loop through employee array
foreach($kdrama as $key => $value) {
echo $key . ": " . $value . "<br>";
}
echo "</td>";
?>
</table>
</center>
</body>
</html>
OUTPUT:-
3350702 DWPD Page | 73
206150307007 DCE-A SUHANI VAISHNAV
PRACTICAL – 15
3350702 DWPD Page | 74
206150307007 DCE-A SUHANI VAISHNAV
Practical-15.2.php:-
INPUT:-
<html>
<head>
<title>practical-15.2</title>
<style>
body{
font-size:30px;
background: linear-gradient(#8e0e00,#1f1c18);
color:white;
}
h1{
font-size:70px;
color:yellow;
}
</style>
</head>
<body>
<center>
<h1>User Defined function</h1>
<form method="post">
Enter a Number: <input type="text" name="input"><br><br>
<input type="submit" name="submit" value="Submit">
</form>
<?php
if($_POST)
{
$input=$_POST['input'];
for ($i = 2; $i <= $input-1; $i++) {
if ($input % $i == 0) {
3350702 DWPD Page | 76
206150307007 DCE-A SUHANI VAISHNAV
$value= True;
}
}
if (isset($value) && $value) {
echo 'The Number '. $input . ' is not prime';
} else {
echo 'The Number '. $input . ' is prime';
}
}
?>
<center>
</body>
</html>
OUTPUT:-
15.1.php:-
15.2.php:-
PRACTICAL – 16
AIM: Try & study several functions as follow: 1. String Functions 2.
Date-time Functions 3. Mathematical Functions
1.String Function:-
INPUT:-
<html>
<head>
<title>practical-16.1</title>
</head>
<style>
body {
background: linear-gradient(#757519,#ccccb2);
color:yellow;
}
table
{
width:1300px;
height:545px;
font-family:Times New roman;
background:linear-gradient(#ba8b02,#181818);
color:white;
font-size:16px;
border-spacing: 5px;
}
th, td {
border:0px solid;
border-collapse:collapse;
}
h2{
font-size:40px;
}
</style>
</style>
<body>
<center>
<table cellpadding="10" cellspacing="5">
<?php
echo "<h2>String Function:</h2>";
echo "<tr>";
echo "<td>";
echo "<h1>chr function</h1>";
echo "Charactor of 68 ascii value is"." ";
echo chr(68)."<br>";
echo "</td>";
echo "<td>";
echo "<h1>ord function</h1>";
echo "Ascii value of first charactor of given string"." ";
echo ord("SUHANI")."<br>";
echo "</td>";
echo "<td>";
echo "<h1>strtolower function</h1>";
echo "Lowercase letter of string SUHANI:"." ";
echo strtolower("SUHANI")."<br>";
echo "</td>";
echo "<td>";
echo "<h1>strtoupper function</h1>";
echo "Upercase letter of string suhani:"." ";
echo strtoupper("SUHANI")."<br>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>";
echo "<h1>strlen function</h1>";
echo "Length of string SUHANI:"." ";
echo strlen("SUHANI")."<br>";
echo "</td>";
echo "<td>";
echo "<h1>ltrim function</h1>";
$s=" suhani";
echo "Before ltrim:".$s."<br>";
echo "</tr>";
echo "<tr>";
echo "<td>";
echo "<h1>stripos function</h1>";
echo "String position(first):"." ";
echo stripos("roman reigns",'e')."<br>";
echo "</td>";
echo "<td>";
echo "<h1>strripos() function</h1>";
echo "String(last occurence):"." ";
echo strripos("roman reigns",'e')."<br>";
echo "</td>";
echo "<td>";
echo "<h1>strstr function</h1>";
echo "String(first occurence):"." ";
echo strstr("roman reigns",'e')."<br>";
echo "</td>";
echo "<td>";
echo "<h1>stristr function</h1>";
echo "Searching string:"."";
echo stristr("roman reigns","ROMAN")."<br>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>";
echo "<h1>str_replace function</h1>";
echo "String replacing:"." ";
echo str_replace("reigns","EMPIRE","ROMAN
reigns")."<br>";
echo "</td>";
echo "<td>";
echo "<h1>strrev function</h1>";
echo "String reversing:"."";
echo strrev("SUHANI")."<br>";
echo "<tr>";
echo "<td>";
?>
</body>
<center>
</table>
</html>
2.Date-Time Function:-
INPUT:-
<html>
<head>
<title>practical-16.2</title>
</head>
<style>
body{
font-size:45px;
background: linear-gradient(#fc00ff,#00dbde);
color:black;
}
h3{
font-size:25px;
color:darkblue;
}
</style>
</head>
<body>
<center>
<?php
echo "Date Function";
echo "<h3><b>date</b> function<h3>";
echo date("d/m/y")."<br>";
echo date("d M,Y");
var_dump(checkdate(2,29,2003));
echo "<br>";
var_dump(checkdate(5,31,2005));
2.Math Function:-
INPUT:-
<html>
<head>
<title>practical-16.3</title>
</head>
<style>
body{
font-size:45px;
background: linear-gradient(#135058,#f1f2b5);
}
table
{
width:1200px;
height:545px;
font-family:Times New roman;
background:linear-gradient(#f1f2b5,#135058);
color:white;
font-size:16px;
border-spacing: 5px;
}
th, td {
3350702 DWPD Page | 84
206150307007 DCE-A SUHANI VAISHNAV
border:0px solid;
border-collapse:collapse;
}
h1{
font-size:50px;
color:black;
}
h3{
font-size:25px;
color:black;
}
</style>
</head>
<body>
<center>
<table cellpadding="10" cellspacing="5">
<?php
echo "<h1>Math Function</h1>";
echo "<tr>";
echo "<td>";
echo "<h3><b>abs</b> function<h3>";
echo abs(-20);
echo "</td>";
echo "<td>";
echo "<h3><b>Ceil</b> function<h3>";
echo ceil(1.4);
echo "<br>";
echo ceil(-1.4);
echo "</td>";
echo "<td>";
echo "<h3><b>Floor</b> function<h3>";
echo floor(1.4);
echo "<br>";
echo floor(-1.4);
echo "</td>";
echo "<td>";
echo "<h3><b>round</b> function<h3>";
echo round(1.3);
echo "<br>";
echo round(1.5);
echo "<br>";
echo round(1.7);
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>";
echo "<h3><b>fmod</b> function<h3>";
$a=5;
$b=2;
$c=fmod($a,$b);
echo $c;
echo "</td>";
echo "<td>";
echo "<h3><b>min</b> function<h3>";
$a=10;
$b=20;
$c=min($a,$b);
echo $c;
echo "</td>";
echo "<td>";
echo "<h3><b>max</b> function<h3>";
$a=5;
$b=2;
$c=fmod($a,$b);
echo $c;
echo "</td>";
echo "<td>";
echo "<h3><b>pow</b> function<h3>";
$a=2;
$b=5;
$c=pow($a,$b);
echo $c;
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>";
echo "<h3><b>sqrt</b> function<h3>";
echo sqrt(4);
echo "</td>";
echo "<td>";
echo "<h3><b>rand</b> function<h3>";
echo rand();
echo "<tr>";
echo "<td>";
?>
</table>
</center>
</body>
</html>
OUTPUT:-
PRACTICAL – 17
AIM: Design a form for registration using form input elements &
display user inserted values in new PHP page. Eg. Library, hospital,
inventory
INPUT:-
<html>
<head>
<title>Registration</title>
<style>
body{
background: linear-gradient(#d1913c,#ffd194);
color:black;
}
label{
font-size:20px;
}
.main
{
width:50%;
margin:2em auto;
border:2px solid black;
padding:1em;
}
.main input[type="submit"]
{
width:95%;
border:1px solid black;
padding:.5em;
margin:.5em;
}
.main input[type="password"]
{
width:70%;
border:1px solid black;
padding:.5em;
margin:.5em;
}
.main input[type="text"],.main input[type="email"],.main
input[type="tel"]
{
width:70%;
border:1px solid black;
padding:.5em;
margin:.5em;
}
#city{
width:70%;
border:1px solid black;
padding:.5em;
margin:.5em;
}
</style>
</head>
<body>
<div class="main">
<form method="post" action="welcome.php">
<h2 align=center>Student Registration</h2>
<hr>
<table width=100%>
<tr>
<td>
<label>Name:</label>
<input type="text" name="fname" placeholder="First Name">
</td>
<td>
<label>Surname:</label>
<input type="text" name="lname" placeholder="Last Name">
</td>
</tr>
<tr>
<td>
<label>E-mail:</label>
<input type="email" name="email" placeholder="Email">
</td>
<td>
<label>Mob No.:</label>
<input type="tel" name="mobile" placeholder="Mobile">
</td>
</tr>
<tr>
<td>
<label>City:</label>
<input list="cities" name="city" id="city" placeholder="City">
<datalist id="cities">
<option value="Surat">
<option value="Bharuch">
<option value="Valsad">
<option value="Vapi">
<option value="Vadodra">
<option value="Ahemdabad">
</datalist>
</td>
<td>
<label>Address:</label>
<textarea name="addr" rows="2" cols="20"
placeholder="Address"></textarea>
</td>
</tr>
</table>
<hr>
<label>D.O.B:</label>
<input type="date" name="date" placeholder="Birth date">
<br><br>
<label>Gender:</label>
<input type="radio" name="gender"
value="Male">Male
<label>Hobbies</label>
<input type="checkbox" name="hobby[]"
value="Cricket">Cricket
<input type="checkbox" name="hobby[]"
value="Football">Football
<input type="checkbox" name="hobby[]"
value="Writing">Writing
<input type="checkbox" name="hobby[]"
value="Gaming">Gaming
<input type="checkbox" name="hobby[ ]"
value="Chess">Chess<br>
<hr>
<label>Username:</label>
<input type="text" name="usrname"
placeholder="Username"><br>
<label>Password:</label>
<input type="Password" name="pass"
placeholder="Password"><br>
<input type="submit" name="submit" value="Register">
</form>
</div>
</body>
</html>
Welcome.php:-
<html>
<style>
body{
color:white;
font-size:18px;
}
table{
width:500px;
background: linear-gradient(#7b4397,#dc2430);
}
table tr th{
padding:18px;
}
</style>
<body>
<center><div>
<table border=1>
<tr>
<th>
<h1><?php
echo "DETAILS";
?></h1>
</th>
</tr>
<tr>
<th>
<?php
if(isset($_POST['submit']))
{
$fn=$_POST['fname'];
$ln=$_POST['lname'];
$em=$_POST['email'];
$mob=$_POST['mobile'];
$add=$_POST['addr'];
$dob=$_POST['date'];
$city=$_POST['city'];
$gender=$_POST['gender'];
$hobies=$_POST['hobby'];
$user=$_POST['usrname'];
$pass=$_POST['pass'];
while($i<sizeof($hobies))
{
echo $hobies[$i]."<br>";
$i++;
}
}
echo "<br><br>Username: $user<br><br>";
echo "Password: $pass <br><br>";
?>
</th>
</tr>
</table>
</div></center>
</body>
</html>
OUTPUT:-
PRACTICAL – 18
AIM: Write two different PHP script to demonstrate passing
variables through a URL. (GET Method)
INPUT:-
<html>
<head>
<style>
body{
font-family: Calibri, Helvetica, sans-serif;
color:white;
}
.container {
width:700px;
padding: 25px;
background-color: #002147;
text-align:left;
}
input[type=text]{
width: 100%;
padding: 15px;
margin: 5px 0 22px 0;
display: inline-block;
border: none;
background: #f1f1f1;
}
input[type=text]:focus{
background-color: orange;
outline: none;
}
div {
padding: 10px 0;
}
hr {
order: 1px solid #f1f1f1;
argin-bottom: 25px;
}
.registerbtn {
background-color: #4CAF50;
color: white;
padding: 16px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
opacity: 0.9;
}
.registerbtn:hover {
opacity: 1;
}
</style>
</head>
<body>
<form method="GET" action="p18.1.php">
<center><div class="container">
<center> <h1> Passing variables through a URL(GET Method) </h1>
</center>
<hr>
<label> Name </label>
<input type="text" name="name" placeholder= "name" size="15"
required />
<label>Phone :</label>
<input type="text" name="phone" placeholder="phone no." size="10"
required>
<label for="email">Email</label>
<input type="text" placeholder="Enter Email" name="email"
required>
<button type="submit" class="registerbtn">Submit</button>
</center>
</form>
</body>
</html>
P18.1.php:-
<html>
<style>
body{
background-color:#32174d ;
color:white;
font-size:18px;
}
table{
width:500px;
}
table tr th{
padding:18px;
}
</style>
<body>
<center><div>
<table border=1>
<tr>
<th>
<h1><?php
echo "DETAILS";
?></h1>
</th>
</tr>
<tr>
<th>
<?php
$n=$_GET['name'];
$p=$_GET['phone'];
$e=$_GET['email'];
echo "NAME :- ".$n."<br/>";
echo "PHONE NO :- ".$p."<br/>";
echo "EMAIL :- ".$e."<br/>";
?>
</th>
</tr>
</table>
</div></center>
</body>
</html>
OUTPUT:-
PRACTICAL – 19
AIM: Write two different PHP script to demonstrate passing
variables using form body. (POST Method)
INPUT:-
<html>
<head>
<style>
body{
font-family: Calibri, Helvetica, sans-serif;
color:white;
}
.container {
width:700px;
padding: 25px;
background:linear-gradient(#0b8793,#360033);
text-align:left;
}
input[type=text]{
width: 100%;
padding: 15px;
margin: 5px 0 22px 0;
display: inline-block;
border: none;
background: #f1f1f1;
}
input[type=text]:focus{
background-color: orange;
outline: none;
}
div {
padding: 10px 0;
}
hr {
</html>
P19.1.php:-
<html>
<style>
body{
color:white;
font-size:18px;
}
table{
background:linear-gradient(#948e99,#2e1437);
width:500px;
}
table tr th{
padding:18px;
}
</style>
<body>
<center><div>
<table border=1>
<tr>
<th>
<h1><?php
echo "DETAILS";
?></h1>
</th>
</tr>
<tr>
<th>
<?php
$n=$_POST['name'];
$p=$_POST['phone'];
$e=$_POST['email'];
echo "NAME :- ".$n."<br/>";
echo "PHONE NO :- ".$p."<br/>";
echo "EMAIL :- ".$e."<br/>";
?>
</th>
</tr>
</table>
</div></center>
</body>
</html>
OUTPUT:-
PRACTICAL – 20
AIM: Write two different PHP script to demonstrate passing
variables through Hidden Variables.
INPUT:-
<html>
<head>
<style>
body{
font-family:"verdana";
background-color:pink ;
}
input[type=text]{
width: 50%;
padding: 15px;
margin: 5px 0 22px 0;
display: inline-block;
border: none;
background: #f1f1f1;
}
nput[type=text]:focus{
background-color: orange;
outline: none;
}
div {
padding: 10px 0;
}
hr {
order: 1px solid #f1f1f1;
argin-bottom: 25px;
}
.registerbtn {
background-color:black;
color: white;
padding: 16px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 50%
opacity: 0.9;
}
.registerbtn:hover {
opacity: 1;
}
</style>
</head>
<body>
<center>
<form method="POST" action="p20.1.php">
<center> <h1> Passing variables through a HIDDEN variable</h1>
</center>
<hr width=70%>
<label> Name:</label>
<input type="text" name="name" placeholder= "name" size="15"
required /><br>
<label for="phone">Phone:</label>
<input type="text" name="phone"placeholder="phone no." size="10"
required><br>
<input type="hidden" value="abc@gmail.com" placeholder="Enter
Email" name="email"
required>
<button type="submit" class="registerbtn">Submit</button>
</form>
</body>
</center>
</html>
P20.1.php:-
<html>
<style>
body{
background:linear-gradient(#1e130c,#9a8478);
color:white;
font-size:18px; }
table{
width:400px; }
table tr th{
padding:18px; }
</style>
<body>
<center><div>
<table border=1>
<tr>
<th><h1>
<?php
echo "DETAILS";
?></h1>
</th> </tr>
<tr>
<th>
<?php
$n=$_POST['name'];
$p=$_POST['phone'];
$e=$_POST['email'];
echo "NAME :- ".$n."<br/><hr>";
echo "EMAIL :- ".$e."<br/><hr>";
echo "PHONE NO :- ".$p."<br/><hr>";
?>
</th> </tr>
</table>
</div></center>
</body>
</html>
OUTPUT:-
PRACTICAL – 21
AIM: Show passing of variables using Cookies. Eg. Facebook
INPUT:
<html>
<head>
<title>Login Form</title>
<style>
body{
background-color:#EFF2FB;
}
table{
width:1200px;
margin:150px;
}
.head{
padding:80px;
text-align:left;
}
font{
font-size:60px;
font-family:sans-serif;
color:#4169e1 ;
}
h2{
font-family:Bahnschrift Light;
color:#585858;
}
.container {
width:400px;
padding: 25px;
background-color:white;
border-radius:5px;
box-shadow: 1px 1px 2px 2px gray;
}
input[type=text]{
width: 80%;
padding: 15px;
margin: 5px 0 22px 0;
display: inline-block;
border-color:#f1f1f1;
border-radius:5px;
}
input[type=text]:focus{
border-color: blue;
outline: none;
}
input[type=password]{
width: 80%;
padding: 15px;
margin: 5px 0 22px 0;
display: inline-block;
border-color:#f1f1f1;
border-radius:5px;
}
input[type=password]:focus{
border-color: blue;
outline: none;
}
hr {
order: 1px solid #f1f1f1;
}
.registerbtn {
3350702 DWPD Page | 109
206150307007 DCE-A SUHANI VAISHNAV
background-color: #4169e1;
color: white;
padding: 16px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 80%;
opacity: 0.9;
border-radius:5px;
}
h4{
color:#4169e1;
size:13px; }
.btn {
background-color:green;
color: white;
padding: 16px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 80%;
opacity: 0.9;
border-radius:5px;
}
.registerbtn:hover {
opacity: 1;
}
</style>
</head>
<body>
<center>
<table>
<tr>
3350702 DWPD Page | 110
206150307007 DCE-A SUHANI VAISHNAV
<th>
<div class="head">
<b><font>facebook</font></b>
<h2>Facebook helps you connect and share with the
people in your life.</h2>
</div>
</th>
<th>
<div class="container">
<form method="post" action=Practical-21.1.php>
<input type="text" name="UserName"
placeholder="Email address or phone no" size="15" required />
<input type="password" name="Password"
placeholder=" Password" size="15" required />
<button type="submit" class="registerbtn">Log
in</button>
<h4>Forgotten Password ?</h4>
<hr>
<button type="submit" class="btn">Create New
Account</button>
</div>
</th>
</tr>
</table>
</center>
</form>
</div>
</body>
</html>
21.1.php:-
<html>
<html>
3350702 DWPD Page | 111
206150307007 DCE-A SUHANI VAISHNAV
<head>
<title></title>
</head>
<style>
body{
font-family:"Gill Sans MT";
background-image:linear-gradient(to bottom , #ff6699 15%,
#33ccff 100%);
font-size:55px;
margin:300px; }
</style>
<body>
<center>
<?Php
$name=$_POST['UserName'];
$password=$_POST['Password'];
if($name=="foram A" and $password=="fa1")
{
setcookie ('UserName', $name);
setcookie ('Password', $password);
header ("Location: Practical-21.2.php"); }
else
{
echo "Wrong username and password ";
}
?>
</body>
</html>
21.2.php:-
<html>
<head>
<style>
3350702 DWPD Page | 112
206150307007 DCE-A SUHANI VAISHNAV
body{
font-family:"Gill Sans MT";
background-image:linear-gradient(to bottom , #ff6699 15%,
#33ccff 100%);
font-size:55px;
text-align:center;
margin:300px; }
</style>
<body>
<?Php
if(isset($_COOKIE['UserName']) and isset($_COOKIE['Password']))
{
echo "Welcome ".$_COOKIE['UserName'];
}
else
{
header ("Location: Practical-21.php"); }
?>
OUTPUT:-
21.1php:-
21.2php:-
PRACTICAL – 22
AIM: Create & manage Session for login system.
INPUT:-
<html>
<html>
<head>
<title>Login Form_session</title>
<style>
body{
background-color:#EFF2FB;
}
table{
width:1200px;
margin:120px;
}
.head{
padding:70px;
text-align:left;
}
font{
font-size:60px;
font-family:sans-serif;
color:#4169e1 ;
}
h2{
font-family:Bahnschrift Light;
color:#585858;
}
.container {
width:400px;
3350702 DWPD Page | 116
206150307007 DCE-A SUHANI VAISHNAV
padding: 25px;
background-color:white;
border-radius:5px;
box-shadow:1px 1px 2px 2px gray;
}
input[type=text]{
width: 80%;
padding: 15px;
margin: 5px 0 22px 0;
display: inline-block;
border-color:#f1f1f1;
border-radius:5px;
}
input[type=text]:focus{
border-color: blue;
}
input[type=password]{
width: 80%;
padding: 15px;
margin: 5px 0 22px 0;
display: inline-block;
border-color:#f1f1f1;
border-radius:5px;
}
input[type=password]:focus{
border-color: blue;
outline: none;
}
hr {
order: 1px solid #f1f1f1;
}
.registerbtn {
background-color: #4169e1;
3350702 DWPD Page | 117
206150307007 DCE-A SUHANI VAISHNAV
color: white;
padding: 16px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 80%;
opacity: 0.9;
border-radius:5px;
}
h4{
color:#4169e1;
size:13px; }
.btn {
background-color:green;
color: white;
padding: 16px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 80%;
opacity: 0.9;
border-radius:5px;
}
.registerbtn:hover {
opacity: 1; }
</style>
</head>
<body>
<center>
<table>
<tr>
<th>
<div class="head">
3350702 DWPD Page | 118
206150307007 DCE-A SUHANI VAISHNAV
<b><font>facebook</font></b>
<h2>Facebook helps you connect and share with the
people in your life.</h2>
</div>
</th>
<th>
<div class="container">
<form method="post" action=Practical-22.1.php>
<input type="text" name="UserName"
placeholder="Email address or phone no" size="15" required />
<input type="password" name="Password"
placeholder=" Password" size="15" required />
<button type="submit" class="registerbtn">Log
in</button>
<h4>Forgotten Password ?</h4>
<hr>
<button type="submit" class="btn">Create New
Account</button>
</div>
</th>
</tr>
</table>
</center>
</form>
</div>
</body>
</html>
22.1.php:-
<html>
<head>
<title>session 1</title>
<style>
3350702 DWPD Page | 119
206150307007 DCE-A SUHANI VAISHNAV
body{
background-color:black;
font-family:"Gill Sans MT";
color:indianred;
font-size:55px;
text-align:center;
margin:200px; }
</style>
</head>
<body>
<?php
session_start();
$name=$_POST['UserName'];
$password=$_POST['Password'];
if($name=="Foram A" && $password=="fa1")
{
$_SESSION['username']=$name;
header("location:Practical-22.2.php");
}
else
{
echo " Wrong Username & Password !!! ";
}
?>
</body>
</html>
22.2.php:-
<html>
<head>
<title>session 2</title>
<style>
body{
3350702 DWPD Page | 120
206150307007 DCE-A SUHANI VAISHNAV
background-color:black;
font-family:"Gill Sans MT";
color:seagreen;
font-size:55px;
text-align:center;
margin:200px;
}
</style>
</head>
<body>
<?php
session_start();
if(isset($_SESSION['username']))
{
echo "Welcome ".$_SESSION['username'];
}
else
{
header("location: Practical-22.php"); }
?>
</body>
</html>
OUTPUT:
22.1php:-
22.2php:-
PRACTICAL – 23
AIM: Write a PHP script to keep track of how many times a visitor
has loaded the page.
INPUT:-
<html>
<head>
<title>Counting Views</title>
<style>
body{
font-family:"Gill Sans MT";
font-size:45px;
margin:350px;
color:brown;
background-color:lightgreen;
}
</style>
</head>
<body>
<center>
<?php
session_start();
$count=0;
if (isset($_SESSION['count']))
{
$_SESSION['count']++;
}
else
{
$_SESSION['count'] = 1;
}
3350702 DWPD Page | 124
206150307007 DCE-A SUHANI VAISHNAV
OUTPUT:-
PRACTICAL – 24
AIM: Write a PHP script to
INPUT:-
<html>
<head>
<title>Database</title>
<style>
body{
font-family:"Gill Sans MT";
font-size:50px;
margin:350px;
color:white;
background:linear-gradient(to right,#cc2b5e , #753a88);
}
</style>
</head>
<body>
<center>
<?php
$c = mysqli_connect("localhost","root");
if($c)
echo "Connected to Database Server";
else
echo "Error while connecting to DB Server";
mysqli_close($c);
?>
<center>
</body>
</html>
24.1php:-
<html>
<head>
<title>Database</title>
<style>
body{
font-family:"Gill Sans MT";
font-size:50px;
margin:350px;
color:white;
background:linear-gradient(to right,#cc2b5e , #753a88);
}
</style>
</head>
<body>
<center>
<?php
$con= mysqli_connect("localhost","root");
if($con)
{
echo "Connected to Database Server<br><br>";
}
$sql = "CREATE DATABASE myDB6";
if ($con->query($sql) === TRUE)
{
echo "Database created successfully\n<br>";
}
else
{
3350702 DWPD Page | 127
206150307007 DCE-A SUHANI VAISHNAV
OUTPUT:-
24.1php:-
PRACTICAL – 25
AIM: Create database using phpMyAdmin.
Step 2 :After starting this services type localhost in your search bar
and a page will open. On this page click on phpMyAdmin option
which is shown in below screenshot.
PRACTICAL – 26
AIM: Write a program to insert data into table from HTML form &
PHP
INPUT:-
<html>
<head>
<title>Registration</title>
<style>
body{
background: linear-gradient( #06beb6 , #48b1bf);
color:black;
}
label{
font-size:20px;
}
.main
{
width:50%;
margin:2em auto;
border:2px solid black;
padding:1em;
}
.main input[type="submit"]
{
width:95%;
border:1px solid black;
padding:.5em;
margin:.5em;
}
.main input[type="password"]
{
width:70%;
border:1px solid black;
padding:.5em;
margin:.5em;
}
.main input[type="text"],.main input[type="email"],.main
input[type="gender"],.main input[type="tel"]
{
width:70%;
border:1px solid black;
padding:.5em;
margin:.5em;
}
#city{
width:70%;
border:1px solid black;
padding:.5em;
margin:.5em;
}
table{
align:center;
}
</style>
</head>
<body>
<center>
<div class="main">
<form method="post" action="practical-26.1.php">
<h1>Details</h1>
<hr>
<center>
<table width=100%>
<tr>
3350702 DWPD Page | 134
206150307007 DCE-A SUHANI VAISHNAV
<td>
<label>Name:</label>
<input type="text" name="first_name" placeholder="First
Name">
</td>
</tr>
<tr>
<td>
<label>Surname:</label>
<input type="text" name="last_name" placeholder="Last
Name">
</td>
</tr>
<tr>
<td>
<label>Gender:</label>
<input type="gender" name="gender" placeholder="Gender">
</td>
</tr>
<tr>
<td>
<label>Address:</label>
<textarea name="address" rows="2" cols="20"
placeholder="Address"></textarea>
</td>
</tr>
<tr>
<td>
<label>E-mail:</label>
<input type="email" name="email" placeholder="Email">
</td>
</tr>
3350702 DWPD Page | 135
206150307007 DCE-A SUHANI VAISHNAV
<tr>
<td>
<input type="submit" name="submit" value="Submit">
<td>
</tr>
</table>
</center>
</form>
</center>
</div>
</body>
</html>
26.1.php:-
<html>
<head>
<title>Insert Page page</title>
</head>
<style>
body{
color:black;
font-size:18px;
}
table{
width:500px;
background: linear-gradient(#bdc3c7 , #2c3e50);
}
table tr th{
padding:18px;
}
</style>
<body>
<center>
3350702 DWPD Page | 136
206150307007 DCE-A SUHANI VAISHNAV
<div>
<table border=1>
<tr>
<th>
<h1><?php
echo "DETAILS";
?>
<hr width-50%>
<?php
$conn = mysqli_connect("localhost", "root", "", "staff");
if($conn === false){
die("ERROR: Could not connect. "
. mysqli_connect_error());
}
$first_name = $_REQUEST['first_name'];
$last_name = $_REQUEST['last_name'];
$gender = $_REQUEST['gender'];
$address = $_REQUEST['address'];
$email = $_REQUEST['email'];
$sql = "INSERT INTO details VALUES ('$first_name',
'$last_name','$gender','$address','$email')";
if(mysqli_query($conn, $sql)){
echo "<h3>Data stored in a database successfully."
. " Please browse your localhost php my admin"
. " to view the updated data</h3>";
mysqli_close($conn);
?>
</h1>
</th>
</tr>
<tr>
<th>
</th>
</tr>
</table>
</center>
</div>
</body>
</html>
OUTPUT:-
26.1php:-
PRACTICAL – 27
AIM: Write a program to read data from table and display all these
information in tabular form on output screen. Eg. GTU Result.
INPUT:-
<html>
<head>
<title>gtu result</title>
<style>
form{
border: 2px dotted black;
height:40%;
width:30%;
padding:15px;
font-size:20px;
}
table{
width:800px;
}
.d1 table tr{
font-size:35px;
padding:20px;
color: #000080;
font-style:sans-serif;
}
.d2 table tr th{
text-align:justify;
padding:5px;
background-color:#EBF5FB;
}
.d3 table{
3350702 DWPD Page | 140
206150307007 DCE-A SUHANI VAISHNAV
border-color:lightgrey;
}
.d3 table tr{
background-color:#CDCCDD;
}
.d5 table{
width:900px;
}
h3{
color:red;
}
h2{
color:green;
}
</style>
</head>
<body>
<center>
<div class="d1">
<table>
<tr>
<td><img src="logo.png" width="120px"
height="100px"></td>
<td><b>Gujarat Technological University
Ahmedabad</b></td>
</tr>
</table>
</div>
<hr width="800px" color="grey">
<div class="main_table">
<tr bgcolor="#E6E4E4">
<table border=1>
<tr>
3350702 DWPD Page | 141
206150307007 DCE-A SUHANI VAISHNAV
<th>SUBJECT CODE</th>
<th>SUBJECT NAME</th>
<th>MARKS</th>
<th>GRADE</th>
</tr>
<?php
$con=mysqli_connect("localhost","root");
mysqli_select_db($con,"GTU");
$sql="select * from GTU";
$result=mysqli_query($con,$sql);
while($row=mysqli_fetch_array($result))
{
$Code=$row['SUBJECT CODE'];
$Name=$row['SUBJECT NAME'];
$Marks=$row['MARKS'];
$Grade=$row['GRADE'];
?>
<tr>
<th><?php echo $Code; ?></th>
<th><?php echo $Name; ?></th>
<th><?php echo $Marks; ?></th>
<th><?php echo $Grade; ?></th>
</tr>
<?php
}
$records=mysqli_num_rows($result);
?>
<tr>
<th><?php echo $records."Records"; ?></th>
</tr>
<?php
mysqli_close($con);
?>
3350702 DWPD Page | 142
206150307007 DCE-A SUHANI VAISHNAV
</table>
<table border="1px" width="50%" style="margin-top: 10px">
<tr><td>Current Sem.Backlog:<b>0</b></td>
<td>Total Backlog:<b>0</b></td>
<td>Total:<b>709</b></td>
<td>SPI :<b>9.50</b></td>
<td>CPI :<b>9.57</b></td>
<td>CGPA :<b>9.32</b></td>
</tr>
</table>
<br>
<?php
{
echo "<h2>Congratulations!! You Have Pass This
Exam...</h2>";
}
?>
<html>
OUTPUT:-
PRACTICAL – 28
AIM: Write a program to update and delete table data.
INPUT:-
28.php:-
<!DOCTYPE html>
<head>
<title>Update Data</title>
</head>
<body style="background-color:#fea099 ;">
<br><br><br>
<center>
<table style="background-color:#fecfcc" border="10">
<tr>
<th>ENROLL</th>
<th>NAME</th>
<th>DEPARTMENT</th>
<th>SEMESTER</th>
<th>CONTACT NO.</th>
</tr>
<?php
$con = mysqli_connect("localhost","root");
$db = mysqli_select_db($con, "college");
$qry = "Select * from college";
$result = mysqli_query($con,$qry);
while($row=mysqli_fetch_array($result)){
$ENROLL=$row['ENROLL'];
$NAME=$row['NAME'];
$DEPARTMENT=$row['DEPARTMENT'];
$SEMESTER=$row['SEMESTER'];
$CONTACT_NO=$row['CONTACT_NO'];
?>
<tr>
<td><?php echo $ENROLL;?></td>
<td><?php echo $NAME;?></td>
<td><?php echo $DEPARTMENT;?></td>
<td><?php echo $SEMESTER;?></td>
<td><?php echo $CONTACT_NO;?></td>
<td><a href="practical-28.2.php?ENROLL=<?php echo
$ENROLL?>">Update</a></td>
<td><a href="practical-28.1.php?ENROLL=<?php echo
$ENROLL?>">Delete</a></td>
</tr>
<?php
}
$records = mysqli_num_rows($result);
mysqli_close($con);
?>
<tr>
<td colspan="5">Total <strong><?php echo $records; ?></strong>
records found.</td>
</tr>
</table>
</center>
</body>
</html>
28.1.php:-
<!DOCTYPE html>
<head>
<title>Update Data</title>
</head>
<body style="background-color:#fea099 ;">
<br><br><br>
<center>
3350702 DWPD Page | 146
206150307007 DCE-A SUHANI VAISHNAV
$records = mysqli_num_rows($result);
mysqli_close($con);
?>
<tr>
<td colspan="5">Total <strong><?php echo $records; ?></strong>
records found.</td>
</tr>
</table>
</center>
</body>
</html>
28.2.php:-
<html>
<head>
<title>UPDATE DATA</title>
</head>
<body style="background-color:#BAA4A6"><br><br><br>
<?php
$ENROLL = $_GET['ENROLL'];
$con = mysqli_connect("localhost","root");
$db = mysqli_select_db($con, "college");
$qry = "SELECT * from college WHERE ENROLL = $ENROLL";
$result = mysqli_query($con,$qry);
while($row=mysqli_fetch_array($result))
{
$ENROLL=$row['ENROLL'];
$NAME=$row['NAME'];
$DEPARTMENT=$row['DEPARTMENT'];
$SEMESTER=$row['SEMESTER'];
$CONTACT_NO=$row['CONTACT_NO'];
}
?>
3350702 DWPD Page | 148
206150307007 DCE-A SUHANI VAISHNAV
</form>
</body>
</html>
28.3.php:-
<html>
<head>
<title>UPDATE DATA</title>
</head>
<style>
body{
font-family:"Gill Sans MT";
font-size:50px;
margin:350px;
color:white;
background: linear-gradient(#e66465, #9198e5);
}
</style>
<body>
<center>
<?php
$ENROLL=$_POST['ENROLL'];
$NAME=$_POST['NAME'];
$DEPARTMENT=$_POST['DEPARTMENT'];
$SEMESTER=$_POST['SEMESTER'];
$CONTACT_NO=$_POST['CONTACT_NO'];
$con=mysqli_connect('localhost','root');
$db = mysqli_select_db($con, "college");
$qry="UPDATE `college` SET `NAME`='$NAME',
`DEPARTMENT`='DEPARTMENT',`SEMESTER`='SEMESTER',`
CONTACT_NO`='CONTACT_NO' WHERE
`ENROLL`='$ENROLL' ";
$result = mysqli_query($con,$qry);
3350702 DWPD Page | 150
206150307007 DCE-A SUHANI VAISHNAV
mysqli_close($con);
echo "<h1> Data Updated Successfully</h1> ";
?>
</center>
</body>
</html>
OUTPUT:-
28.php:-
28.1.php:-
28.2.php:-
28.3.php:-