Department of Computer Science and Engineering

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 33

SIR M VISVESVARAYA INSTITUTE OF TECHNOLOGY

(Affiliated to VTU, Recognized by AICTE and Accredited by NBA, NAAC


and an ISO 9001-2008 Certified Institution)
Bengaluru – 562157

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

WEB TECHNOLOGY LABORATORY WITH MINI PROJECT


CHOICE BASED CREDIT SYSTEM
17CSL77- VII Semester B.E
(Academic Year 2020-21)

it Lakhanpal USN : 1MV17CS127Branch:CSE Semest

Compiled and Prepared by: Under the Guidance of:


Mrs.M.G.Kousar & Mr.Suraj Kumar B P Dr. G. C. Bhanu Prakash
Assistant Professor Professor. & Head
Dept. of CSE
Dept. of CSE

Department Vision an
VISION
To build a center for imparting quality technical education and carrying out research activity to meet
MISSION
The computer science and engineering department strives for excellence in teaching, applying, promoting and imparting kn
Train students to effectively apply the knowledge to solve real-world problems, thus enhance their potential for a life-long
Prepare students to demonstrate a sense of societal and ethical responsibilities in their professional endeavors.
Creating amongst students and faculty a collaborative environment, open to the free exchange of ideas, which leads to rese
Program Educational Objectives

PEO's PEO Description


The graduates exhibit professionalism, communication skills for effective teamwork
PEO1 and will have a successful career as Information Technology professionals and work with
values and social concern.
The graduates have strong foundation in the mathematical, scientific and engineering
fundamentals and Engineering practices necessary to formulate, solve and analyse
PEO2
engineering problems which enables them for higher education, research and development
activities.
The graduate demonstrate lifelong learning in the field of computation by up-
PEO3
gradation of knowledge skills and abide by professional ethics.

PROGRAM OUTCOMES

PO's PO Description
Engineering knowledge: Apply the knowledge of mathematics, science, engineering
PO1 fundamentals, and an engineering specialization to the solution of complex engineering
problems.
Problem analysis: Identify, formulate, review research literature, and analyze Complex
PO2 engineering problems reaching substantiated conclusions using first principles of mathematics,
natural sciences, and engineering sciences.
Design/development of solutions: Design solutions for complex engineering
problems and design system components or processes that meet the specified needs
PO3
with appropriate consideration for the public health and safety, and the cultural, societal, and
environmental considerations.
Conduct investigations of complex problems: Use research-based knowledge and research
PO4 methods including design of experiments, analysis and interpretation of data, and synthesis
of the information to provide valid conclusions.
Modern tool usage: Create, select, and apply appropriate techniques, resources, and
PO5 modern engineering and IT tools including prediction and modeling to complex
engineering activities with an understanding of the limitations.
The engineer and society: Apply reasoning informed by the contextual knowledge to assess
PO6 societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to
the professional engineering practice.
Environment and sustainability: Understand the impact of the professional engineering
PO7 solutions in societal and environmental contexts, and demonstrate the knowledge of, and need
for sustainable development.
Ethics: Apply ethical principles and commit to professional ethics and responsibilities
PO8
and norms of the engineering practice.
Individual and team work: Function effectively as an individual, and as a member or leader in
PO9
diverse teams, and in multidisciplinary settings.
Communication:Communicate effectively on complex engineering activities with the
engineering community and with society at large, such as,being able to comprehend and
PO10
write effective reports and design documentation, make effective presentations, and give and
receive clear instructions.
Project management and finance: Demonstrate knowledge and understanding of
the engineering and management principles and apply these to one’s own work, as a
PO11
member and leader in a team, to manage projects and in multidisciplinary environments.

Life-long learning: Recognize the need for, and have the preparation and ability to engage in
PO12 independent and life-long learning in the broadest context of technological change.

PROGRAM SPECIFIC OUTCOMES

PSO's PSO Description


An ability to design and analyse algorithms by applying theoretical concepts to build complex
PSO1 and computer- based systems in the domain of System Software, Computer Networks &
Security, Web technologies, Data Science and Analytics.
Be able to develop various software solutions by applying the techniques of Data
PSO2 Base Management,Complex Mathematical Models, Software Engineering practices and
Machine Learning with Artificial Intelligence.
SIR M VISVESVARAYA INSTITUTE OF TECHNOLOGY
(Affiliated to VTU, Recognized by AICTE and Accredited by NBA,
NAAC and an ISO 9001-2008 Certified Institution)
Bengaluru – 562157

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

CERTIFICATE

This is to certify that Mr/Ms. Sunchit Lakhanpal

bearing USN 1MV17CS127 has completed the

WEB TECHNOLOGY LABORATORY WITH MINI PROJECT

(17CSL77) prescribed by Visvesvaraya Technological University for

Seventh Semester, academic year 2020 - 2021

Name and Signature of Staff

Signature of HOD
WEB TECHNOLOGY LABORATORY WITH MINI PROJECT 17CSL77

Scheme and Syllabus


WEB TECHNOLOGY LABORATORY WITH MINI PROJECT
[As per Choice Based Credit System (CBCS) scheme]
(Effective from the academic year 2018 -2019)
SEMESTER - VII
Laboratory Code 17CSL77 IA Marks 40
Number of Lecture Hours/Week 01I + 02P Exam Marks 60
Total Number of Lecture Hours 40 Exam Hours 3
CREDITS - 02
Description (If any):
Laboratory Experiments :
PART A
1. Write a JavaScript to design a simple calculator to perform the following operations: sum,
product, difference and quotient.
2. Write a JavaScript that calculates the squares and cubes of the numbers from 0 to 10 and
outputs HTML text that displays the resulting values in an HTML table format.
3. Write a JavaScript code that displays text “TEXT-GR OWING” with increasing font size
in the interval of 100ms in RED COLOR, when the font size reaches 50pt it displays
“TEXT-SHRINKING” in BLUE color. Then the font size decreases to 5pt.
4. Develop and demonstrate a HTML5 file that includes JavaScript script that uses functions
for the following problems:
a. Parameter: A string
b. Output: The position in the string of the left-most
c. Parameter: A number
d. Output: The number with its digits in the reverse order
5. Design an XML document to store information about a student in an engineering college
affiliated to VTU. The information must include USN, Name, and Name of the College,
Branch, Year of Joining, and email id. Make up sample data for 3 students. Create a CSS
style sheet and use it to display the document.
6. Write a PHP program to keep track of the number of visitors visiting the web page and to
display this count of visitors, with proper headings.
7. Write a PHP program to display a digital clock which displays the current time of the
server.
8. Write the PHP programs to do the following:
a. Implement simple calculator operations.
b. Find the transpose of a matrix.
c. Multiplication of two matrices.
d. Addition of two matrices.

Department of Computer Science and Engineering, Sir Page 1


MVIT
WEB TECHNOLOGY LABORATORY WITH MINI PROJECT 17CSL77

9. Write a PHP program named states.py that declares a variable states with value
"Mississippi Alabama Texas Massachusetts Kansas". write a PHP program that does the
following:
a. Search for a word in variable states that ends in xas. Store this word in element 0
of a list named statesList.
b. Search for a word in states that begins with k and ends in s. Perform a case-
insensitive comparison. [Note: Passing re.Ias a second parameter to method
compile performs a case-insensitive comparison.] Store this word in element1 of
statesList.
c. Search for a word in states that begins with M and ends in s. Store this word in
element 2 of the list.
d. Search for a word in states that ends in a. Store this word in element 3 of the list.
10. Write a PHP program to sort the student records which are stored in the database using
selection sort.
Course objectives: This course will enable students to
1. Design and develop static and dynamic web pages.
2. Familiarize with Client-Side Programming, Server-Side Programming, Active server
Pages.
3. Learn Database Connectivity to web applications

Study Experiment / Project:

Develop a web application project using the languages and concepts learnt in the theory and
exercises listed in part A with a good look and feel effects. You can use any web technologies
and frameworks and databases.
Note:
1. In the examination each student picks one question from part A.
2. A team of two or three students must develop the mini project. However during
the examination, each student must demonstrate the project individually.
3. The team must submit a brief project report (15-20 pages) that must include the
following
a. Introduction
b. Requirement Analysis
c. Software Requirement Specification
d. Analysis and Design
e. Implementation
f. Testing

Course outcomes: The students should be able to:


1. Design and develop dynamic web pages with good aesthetic sense of designing and latest
technical know-how's.
2. Have a good understanding of Web Application Terminologies, Internet Tools other web
services.
3. Learn how to link and publish web sites

Department of Computer Science and Engineering, Sir Page 2


MVIT
Conduction of Practical Examination:

1. All laboratory experiments from part A are to be included for practical examination.
2. Mini project has to be evaluated for 30 Marks.
3. Report should be prepared in a standard format prescribed for project work.
4. Students are allowed to pick one experiment from the lot.
5. Strictly follow the instructions as printed on the cover page of answer script.
6. Marks distribution:
a. Part A: Procedure + Conduction + Viva: 09 + 42 +09 =60 Marks
b. Part B: Demonstration + Report + Viva voce = 20+14+06 = 40 Marks
Change of experiment is allowed only once and marks allotted to the procedure part to be
made zero
WEB TECHNOLOGY LABORATORY WITH MINI PROJECT 17CSL77

Index
Page Marks Staff
Experiment Number allotted Sign
1. Write a JavaScript to design a simple calculator to perform the 5-6
following operations: sum, product, difference and quotient.
2. Write a JavaScript that calculates the squares and cubes of the numbers 7-8
from 0 to 10 and outputs HTML text that displays the resulting values
in an HTML table format.
3. Write a JavaScript code that displays text “TEXT-GR OWING” with 9-10
increasing font size in the interval of 100ms in RED COLOR, when the
font size reaches 50pt it displays “TEXT-SHRINKING” in BLUE color.
Then the f ont size decreases to 5pt.
4. Develop and demonstrate a HTML5 file that includes JavaScript script 11-12
that uses functions for the following problems:
a. Parameter: A string
b. Output: The position in the string of the left-most
c. Parameter: A number
d. Output: The number with its digits in the reverse order
5. Design an XML document to store information about a student in an 13-14
engineering college affiliated to VTU. The information must include
USN, Name, and Name of the College, Branch, Year of Joining, and
email id. Make up sample data for 3 students. Create a CSS style sheet
and use it to display the document.
6. Write a PHP program to keep track of the number of visitors visiting 15-16
the web page and to display this count of visitors, with proper
headings.
7. Write a PHP program to display a digital clock which displays the current 17-18
time of the server.
8. Write the PHP programs to do the following: 19-22
a. Implement simple calculator operations.
b. Find the transpose of a matrix.
c. Multiplication of two matrices.
d. Addition of two matrices.
9. Write a PHP program named states.py that declares a variable states 23-24
with value "Mississippi Alabama Texas Massachusetts Kansas". write a
PHP program that does the following:
a. Search for a word in variable states that ends in xas. Store this word
in element 0 of a list named states List.
b. Search for a word in states that begins with k and ends in s. Perform
a case-insensitive comparison. [Note: Passing re.Ias a second
parameter to method compile performs a case-insensitive
comparison.] Store this word in element1 of states List.
c. Search for a word in states that begins with M and ends in s. Store
this word in element 2 of the list.
d. Search for a word in states that ends in a. Store this word in
element 3 of the list.
10. Write a PHP program to sort the student records which are stored in 25-27
the database using selection sort.

Department of Computer Science and Engineering, Sir Page 4


MVIT
Program No. 1

1. Write a JavaScript to design a simple calculator to perform the following operations: sum,
product, difference and quotient.

Program
<html>
<title>CALCULATOR</title>
<style>
input{ width:100%; padding:30px; } input:hover{background: silver;}
</style>
<body>
<div align="center">
<h2>SIMPLE CALCULATOR</h2>
<script type="text/javascript">
a = ['7','8','9','+','4','5','6','-','1','2','3','*','c','0','=','/']
z = '<td> <input type="button" value="'
document.write('<form name="cal"><table><tr><td colspan="8">
<input type="text" name="get"></td></tr><tr>');
for (var i = 0; i<16; i++) {
if(i==12){
document.write('<td> <input type="reset" value="c" ></td>'); continue ;}
if(i==14){
document.write('<td><input type="button"
value="=" onclick="cal.get.value =eval(cal.get.value)"></td>');continue ;}
if(i==3||i==7||i==11){
document.write(z+a[i]+'" onclick="cal.get.value +=\''+a[i]+'\'"></td></tr><tr
rowspan="2">');
continue ;}
else
document.write(z+a[i]+'" onclick="cal.get.value +=\''+a[i]+'\'"></td>');
}
document.write('</table></form></div>');
</script>
</body>
</html>
Program No. 2
2. Write a JavaScript that calculates the squares and cubes of the numbers from 0 to 10 and
outputs HTML text that displays the resulting values in an HTML table format.

Program
<html>
<head><title> Squares and Cubes </title></head>
<script >

document.write('<p><b>SQUARES AND CUBES FROM 0 TO 10</b></p>');


document.write('<table border="2" cellspacing="2">');
document.write('<th> Number </th> <th> Square </th> <th> Cube </th>');
for(var i=1;i<=10;i++)
document.write("<tr><td>" + i + "</td> "+"<td>" + i * i + "</td> " + "<td>" + i*i*i +
"</td></tr>");
document.write("</table>");
</script>

</html>
WEB TECHNOLOGY LABORATORY WITH MINI PROJECT 17CSL77

Department of Computer Science and Engineering, Sir Page 9


MVIT
WEB TECHNOLOGY LABORATORY WITH MINI PROJECT 17CSL77

Program No. 3
3. Write a JavaScript code that displays text “TEXT-GROWING” with increasing font size in
the interval of 100ms in RED COLOR, when the font size reaches 50pt it displays “TEXT-
SHRINKING” in BLUE color. Then the font size decreases to 5pt..

Program
<!DOCTYPE html>
<html>
<body>
<div id="h"></div>
<script>
var v = 0, f = 1,t="TEXT-GROWING",color;
function a(){
if(f==1) v+=5,color="red"; else v-=5,color="blue";
document.getElementById("h").innerHTML =
"<h1 style=\"font-size: "+v+"px ; margin: 0px;
color : "+color+"\"><b> "+t+"</b></h1>";
if(v==50) f = 0,t="TEXT-SHRINKING";
if(v==5) f = 1,t="TEXT-GROWING";
c();
}
Department of Computer Science and Engineering, Sir Page 10
MVIT
WEB TECHNOLOGY LABORATORY WITH MINI PROJECT 17CSL77
function c(){ setTimeout(a,300); }
c();
</script>
</body>
</html>

Department of Computer Science and Engineering, Sir Page 11


MVIT
WEB TECHNOLOGY LABORATORY WITH MINI PROJECT 17CSL77

Department of Computer Science and Engineering, Sir Page 12


MVIT
WEB TECHNOLOGY LABORATORY WITH MINI PROJECT 17CSL77

Program No. 4
4. Develop and demonstrate a HTML5 file that includes JavaScript script that uses functions
for the following problems:
a. Parameter: A string
b. Output: The position in the string of the left-most
c. Parameter: A number
d. Output: The number with its digits in the reverse order

Program
<script>
var a = prompt("Enter The Query"),b = parseInt(a),z=0;
if(b) {
while(b>0)
var r= b%10, z= z*10+r, b = Math.floor(b/10);
document.write("Entered Query : "+ a +"<br> Given Number In Reverse
Order : "+ z);
}
else {
a = a.search(/[aeiouAEIOU]/);
document.write("The First Occurence Of Vowel is at : "+ (a+1));
}
</script>

Department of Computer Science and Engineering, Sir Page 13


MVIT
Program No. 5
5. Design an XML document to store information about a student in an engineering college
affiliated to VTU. The information must include USN, Name, and Name of the College,
Branch, Year of Joining, and email id. Make up sample data for 3 students. Create a CSS
style sheet and use it to display the document

Program
Prog5.css:

*{
display: block; font-size: 20px;
}
USN {
color: blue;
font-size: 30px;
margin-top: 20px;
}

Prog5.xml:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="PROG5.css"?>
<STUDENTDATA>
<STUDENT>
<USN>USN : 1MV17CS127</USN>
<NAME>NAME : Sunchit Lakhanpal</NAME>
<COLLEGE>COLLEGE : MVIT</COLLEGE>
<BRANCH>BRANCH :CSE</BRANCH>
<YEAR>YEAR : 2020</YEAR>
<EMAIL>E-MAIL : [email protected]</EMAIL>
</STUDENT>
<STUDENT>
<USN>USN : 1MV17CS129</USN>
<NAME>NAME : KUSHAL PALA</NAME>
<COLLEGE>COLLEGE : MVIT</COLLEGE>
<BRANCH>BRANCH :CSE</BRANCH>
<YEAR>YEAR : 2020</YEAR>
<EMAIL>E-MAIL : [email protected]</EMAIL>
</STUDENT>

<STUDENT>
<USN>USN : 1MV17CS126</USN>
<NAME>NAME : DIMPLE</NAME>
<COLLEGE>COLLEGE : MVIT</COLLEGE>
<BRANCH>BRANCH :CSE</BRANCH>
<YEAR>YEAR : 2020</YEAR>
<EMAIL>E-MAIL : [email protected]</EMAIL>
</STUDENT>
</STUDENTDATA>
WEB TECHNOLOGY LABORATORY WITH MINI PROJECT 17CSL77

Program No. 6
6. Write a PHP program to keep track of the number of visitors visiting the web page and to
display this count of visitors, with proper headings

Program

<?php
echo "<h1> REFRESH PAGE </h1>" ;
$file = 'count.txt' ;
$c = file_get_contents($file) ;
file_put_contents($file, $c+1);
echo "The number of users visited : ".$c ;
?>

Department of Computer Science and Engineering, Sir Page 17


MVIT
WEB TECHNOLOGY LABORATORY WITH MINI PROJECT 17CSL77

Department of Computer Science and Engineering, Sir Page 18


MVIT
WEB TECHNOLOGY LABORATORY WITH MINI PROJECT 17CSL77

Program No. 7
7. Write a PHP program to display a digital clock which displays the current time of the server.

Program
<head>
<meta http-equiv="refresh" content="1"/>
<style>
p{
color:yellow;
font-size:90px;
position:absolute;
top: 40%;
left: 50%;
transform: translate(-50%, -50%);
}
body {
background-color:maroon;
}
</style>
<p> <?php echo date(" h: i : s A");?> </p>
</head>

Department of Computer Science and Engineering, Sir Page 19


MVIT
WEB TECHNOLOGY LABORATORY WITH MINI PROJECT 17CSL77

Department of Computer Science and Engineering, Sir Page 20


MVIT
WEB TECHNOLOGY LABORATORY WITH MINI PROJECT 17CSL77

Program No. 8

8. Write the PHP programs to do the following:


a. Implement simple calculator operations.
b. Find the transpose of a matrix.
c. Multiplication of two matrices.
d. Addition of two matrices.

Program
CALCULATOR:

<html>
<head>
<style>
table, td, th {
border: 1px solid black;
width: 35%;
text-align: center;
background-color: lightgray;
}
table { margin: auto; }
input,p { text-align:right; }
</style>
</head>

<body>
<form method="post" action="prog8a.php">
<table>
Department of Computer Science and Engineering, Sir Page 21
MVIT
WEB TECHNOLOGY LABORATORY WITH MINI PROJECT 17CSL77

<caption><h2> SIMPLE CALCULATOR </h2></caption>


<tr>
<td>First Number:</td><td><input type="text" name="num1" /></td>
<td rowspan="2"><button type="submit" name="submit"
value="calculate">Calculate</td></tr>
<tr>
<td>Second Number:</td><td><input type="text" name="num2"/></td>
</tr>
</form>
<?php
if(isset($_POST['submit'])) // it checks if the input submit is filled
{
$num1 = $_POST['num1'];
$num2 = $_POST['num2'];
if(is_numeric($num1) and is_numeric($num2) )
{
echo "<tr><td> Addition :</td><td><p>".($num1+$num2)."</p></td>";
echo "<tr><td> Subtraction :</td><td><p> ".($num1-
$num2)."</p></td>";
echo "<tr><td> Multiplication :</td><td><p>".
($num1*$num2)."</p></td>";
echo "<tr><td>Division :</td><td><p> ".($num1/$num2)."</p></td>";
echo "</table>";
}
else
{
echo"<script> alert(' ENTER VALID NUMBER');</script>";
}
}
?>
</body>
</html>

Department of Computer Science and Engineering, Sir Page 22


MVIT
MATRIX:

<!DOCTYPE html>
<html>
<body>
<?php
function pr($a){
foreach ($a as $b) {
foreach ($b as $c) {
echo $c ." ";
}echo "<br>";
}echo "<br>";
}
$a = [[1,2,3],[4,5,6],[7,8,9]];
$b = [[7,8,9],[4,5,6],[1,2,3]];
echo "<b>First Matrix : </b><br>" ; pr($a);
echo "<b>Second Matrix : </b><br>"; pr($b);
for ($i=0; $i < 3; $i++)
for ($j=0; $j < 3; $j++)
$c[$i][$j] = $a[$j][$i];
echo "<b>Transpose Of First Matrix : </b><br>"; pr($c);
for ($i=0; $i < 3; $i++)
for ($j=0; $j < 3; $j++)
$c[$i][$j] = $a[$i][$j] + $b[$i][$j];
echo "<b>Addition Of Two Matrix : </b><br>"; pr($c);
for ($i=0; $i < 3; $i++)
for ($j=0; $j < 3; $j++){
$c[$i][$j] = 0;
for ($k=0; $k < 3; $k++)
$c[$i][$j] += $a[$i][$k] * $b[$k][$j];
}
echo "<b>Multiplication Of Two Matrix : </b><br>"; pr($c);
?>
</body>
</html>
WEB TECHNOLOGY LABORATORY WITH MINI PROJECT 17CSL77

Program No. 9

9. Write a PHP program named states.py that declares a variable states with value
"Mississippi Alabama Texas Massachusetts Kansas". write a PHP program that does the
following:
a. Search for a word in variable states that ends in xas. Store this word in element 0 of
a list named states List.
b. Search for a word in states that begins with k and ends in s. Perform a case-insensitive
comparison. [Note: Passing re.Ias a second parameter to method compile performs a
case-insensitive comparison.] Store this word in element1 of states List.
c. Search for a word in states that begins with M and ends in s. Store this word in
element 2 of the list.
d. Search for a word in states that ends in a. Store this word in element 3 of the list

Program:
<html>
<body>
<?php
$states = "Mississippi Alabama Texas Massachusetts Kansas";
$b = explode(' ',$states);
echo "<br>ORIGINAL ARRAY :<br>";
foreach ( $b as $i => $value )
echo "states[$i] = $value<br>";
foreach ($b as $c)
{
$n = strlen($c);
if($c[$n-1]=='s' && $c[$n-2]=='a' && $c[$n-3]=='x') $d[0] = $c;
if($c[0]=='K' && $c[$n-1]=='s') $d[1] = $c;
if($c[0]=='M' && $c[$n-1]=='s') $d[2] = $c;
if($c[$n-1]=='a') $d[3] = $c;
}
echo "<br>RESULTANT ARRAY :<br>";
for ($i=0; $i < count($d); $i++)
echo "statesList[$i] = $d[$i]<br>";
?>
</body>
</html>

Department of Computer Science and Engineering, Sir Page 25


MVIT
WEB TECHNOLOGY LABORATORY WITH MINI PROJECT 17CSL77

Department of Computer Science and Engineering, Sir Page 26


MVIT
WEB TECHNOLOGY LABORATORY WITH MINI PROJECT 17CSL77

Program No. 10
10. Write a PHP program to sort the student records which are stored in the database using
selection sort.

Program
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "weblab";
$conn = mysqli_connect($servername, $username, $password, $dbname);
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$sql = "SELECT * FROM student";
$result = $conn->query($sql);
$usn = array() ;
echo "<table border='2'><caption>Before Sorting </caption><br>";
echo "<tr><th>USN</th><th>NAME</th><th>Marks</th></tr>";
if ($result->num_rows > 0)
{
while($row = $result->fetch_assoc())
{
echo "<tr><td>". $row["usn"]."</td>";
echo "<td>". $row["name"]."</td>";
echo "<td>". $row["marks"]."</td></tr>";
$usn[] = $row["usn"] ;
}
}
$n = sizeof($usn) ;
for($i = 0 ; $i < $n-1 ; $i++ )
{
$pos = $i ;
for($j = $i + 1 ; $j < $n ; $j++ )
{
if( $usn[$pos] < $usn[$j])
{
$pos = $j ;
}
}

Department of Computer Science and Engineering, Sir Page 27


MVIT
WEB TECHNOLOGY LABORATORY WITH MINI PROJECT 17CSL77

if( $pos != $i)


{
$temp = $usn[$i] ;
$usn[$i] = $usn[$pos] ;
$usn[$pos] = $temp ;
}
}
$name = [] ;
$marks = [] ;
$result = $conn->query($sql);
if ($result->num_rows> 0)
{
while($row = $result->fetch_assoc())
{
for($i=0;$i<$n;$i++)
{
if($row["usn"] == $usn[$i])
{
$name[$i]=$row["name"];
$marks[$i]=$row["marks"];
}
}
}
}
echo "<br><table border='2'><caption>After Sorting </caption><br>";
echo "<tr><th>USN</th><th>NAME</th><th>Marks</th></tr>";
for($i = 0 ; $i < sizeof($usn) ; $i++)
{
echo "<tr><td>". $usn[$i]."</td>";
echo "<td>". $name[$i]."</td>";
echo "<td>". $marks[$i]."</td></tr>";
}
?>

Department of Computer Science and Engineering, Sir Page 28


MVIT
SIR M VISVESVARAYA INSTITUTE OF TECHNOLOGY
(Affiliated to VTU, Recognized by AICTE and Accredited by NBA,
NAAC and an ISO 9001-2008 Certified Institution)
Bengaluru – 562157

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

LAB EVALUATION

1MV17CS127
USN : SEMESTER / SECTION : 7 /B

SUNCHIT LAKHANPAL
STUDENT NAME :

WEB Technology Laboratory


SUBJECT NAME : SUBCODE : 17CSL77
with Mini Project

Present & Communicate Understanding of Interpretation &


Effectively Fundamental Knowledge Analysis of result

WEAK MEDIUM HIGH WEAK MEDIUM HIGH WEAK MEDIUM HIGH

Signature of the Faculty

You might also like