WT Manual With Code
WT Manual With Code
LABORATORY MANUAL
AY: 2022-23
TE Computer
Engineering Semester –II
Subject Code - 310257
Prepared By:
List of Assignment
1. Case study
Before coding of the website, planning is important, students should visit 4different
websites (Min. 5) for the different client projects and note down the evaluation results for
these websites, either good website or bad website
2. Design and develop any suitable web application using HTML, CSS.
3. Design and develop any suitable web application using XML and CSS.
4. Design and develop any suitable web application using HTML, Java Script for form
validation.
5. Design and develop any suitable web application using JSP, Servlet and
MySQL(Backend)
6. Add dynamic web application essence using PHP, HTML and MySQL.
7. Add dynamic web application essence using PHP, AJAX and MySQL.
8. Design and develop any web application using Struts framework.
9. Design and develop any web application using AngularJS.
10. Design and implement a business interface with necessary business logic for any web
application using EJB.
11. Mini Project
Assignment No:1 Date:
Sign: Remark:
ASSIGNMENT 1
TITLE:
Before coding of the website, planning is important,students should visit different websites (Min. 5) for the different client
projects and note down the evaluation results for these websites, either good website or bad website
PROBLEM STATEMENT:
Sr Website Purpose of Things Things Overall
. URL Website liked disliked in evaluation
N in the the website of the
o. website website
(Good/Bad
)
OUTCOME:
THEORY-CONCEPT:
CONCLUSION / ANALYSIS:
OUTPUT:
Assignment No:2 Date:
Sign: Remark:
ASSIGNMENT 2
TITLE:
Design and develop any suitable web application using HTML, CSS.
OBJECTIVES:
1. Understand about basic concepts of html
2. Understand the basic concepts of XML
3. Understand the basic concepts of CSS
PROBLEM STATEMENT:
Write a program to design registration form for students by using HTML and CSS
OUTCOME
Students will be able to,
1. Design static webpage using HTML.
2. Apply CSS to HTML pages.
THEORY-CONCEPT
HTML: HTML is the standard markup language for creating Web pages.
HTML stands for Hyper Text Markup Language
HTML describes the structure of Web pages using markup
HTML elements are the building blocks of HTML pages
HTML elements are represented by tags
HTML tags label pieces of content such as "heading", "paragraph", "table", and so on
Browsers do not display the HTML tags, but use them to render the content of the page
CSS:
CSS stands for Cascading Style Sheet. It is nothing, but design language intended to simplify the
process of making web pages presentable.CSS handles the feel and look part of a web page. By using
CSS, one can control the color of text, style of fonts, spacing between paragraphs, layout designs.
CSS is easy to learn, easy to understand and it provides powerful control on presentation of an HTML
document.
Advantages of CSS:
It saves the time, Pages load faster, Easy maintenance, Superior styles to HTML, Multiple Device
Compatibility, Global web standards, Offline Browsing, Platform Independence. CSS3 Modules:
CSS3 Modules are having old CSS specifications as well as extension features.
Box Model
Selectors
Background
Border
Image Values and Replaced Content
Text Effects
TECHNOLOGY / TOOL:
The <!DOCTYPE html> declaration defines this document to be HTML5
The <html> element is the root element of an HTML page
The <head> element contains meta information about the document
The <title> element specifies a title for the document
The <body> element contains the visible page content
The <h1> element defines a large heading
The <p> element defines a paragraph
HTML tags are element names surrounded by angle brackets:
<tagname>content goes here...</tagname>
CSS can be added to HTML elements in 3 ways:
Inline - by using the style attribute in HTML elements. An inline CSS is used to apply a
unique style to a single HTML element.
Ex. <h1 style="color:blue;">This is a Blue Heading</h1>
Internal - by using a <style> element in the <head> section. An internal CSS is used to define a
style for a single HTML page. An internal CSS is defined in the <head> section of an HTML page,
within a <style> element.
Example:<style>
body {background-color: powderblue;} h1
{color: blue;}
p {color: red;}
</style>
External - by using an external CSS file. An external style sheet is used to define the style for
many HTML pages. With an external style sheet, you can change the look of an entire web site, by
changing one file!To use an external style sheet, add a link to it in the
<head> section of the HTML page.
Example: <link rel="stylesheet" href="styles.css">
Use the HTML <head> element to store <style> and <link> elements
Use the CSS color property for text colors
Use the CSS font-family property for text fonts
Use the CSS font-size property for text sizes
Use the CSS border property for borders
Use the CSS padding property for space inside the border
Use the CSS margin property for space outside the border
CONCLUSION/ANALYSIS:
Hence, we have designed static web pages using HTML and CSS.
CODE:
Display.css
<html>
<head>
<title> display</title>
</head>
<body>
<h1 style="color:blue;margin-left:30px;"> You have submitted the form successfully </h1>
</body>
</html>
samp.css
.con
{
width:400px; height:400px;
background-color:white;
color:blue;
padding:0px 10px 0px 10px;
margin:auto;
}
.main
{
width:400px;
height:80px;
float:left;
padding:60px 10px 10px10px;
margin: auto;
}
.con1
{
width:200px;
height:30px;
float:left;
margin:auto;
padding:0px 0px 0px0px;
}
.con2
{
width:150px;
height:30px;
float:left;
margin:10px 10px 10px10px;
padding:0px 0px 0px0px;
}
#terms
{
color:blue;
padding-left:400px;
}
two.html
<html>
<head>
<title>regform</title>
<link href="samp.css"
rel="stylesheet"></link> </head>
<body>
<div class="con">
<form action="display.html" method="get" align="center">
<div class="con2">
<imgsrc="/home/sanyuja/Desktop/b.jpg" width=380px height=100px alt="img">
</div>
<div class="main">
<table align="center">
<tr>
<td><h1>Welcome to Registration
Page</h1></td></tr> </table>
<div class="con1">
<table align="center">
<tr>
<td>Full Name:</td>
<td><input type="text" value=""></input></td>
</tr>
<tr>
<td>Select Gender</td>
<td><input type="radio" name="gender"/>Female</input>
<input type="radio" name="gender"/>Male</input></td> </tr>
<br>
<tr>
<td>Class</td>
<td><input type="text" value=""></input></td>
</tr>
<br>
<tr>
<td>Skills</td>
<td><input type="checkbox" value="">C </input>
<input type="checkbox" value="">C++</input> <input
type="checkbox" value="">JAVA</input> <input
type="checkbox" value="">PHP</input> <input
type="checkbox" value="">AJAX</input></td>
</tr>
<br>
<tr>
<td>Department</td>
<td>
<select>
<option value="comp">COMPUTER</option> <option
value="it">Information Technology</option>
<option value="it">Electronics & Telecomunications</option>
<option value="mech">Mechnical</option>
<option value="civil">Civil</option>
</select>
</td>
</tr>
<tr>
<td>email:</td>
<td><input type="text" value=""></input></td>
</tr>
<tr>
<td>phone:</td>
<td><input type="text" value=""></input></td>
</tr>
<tr></tr><tr></tr>
</table>
<table align="center">
<tr>
<td><input type="submit" value="SUBMIT"></td>
<td><input type="reset" value="CANCEL"></td>
</td>
</tr>
</table>
</div>
</div>
</form>
</div>
<br><br><br><br>
<div id="terms">
<span>By clicking Submit you agree to our Terms &
Conditions</span> </div>
</body>
</html>
OUTPUT:
Assignment No:3 Date:
Sign: Remark:
ASSIGNMENT 3
TITLE:
Design and develop any suitable web application using XML and CSS.
PROBLEM STATEMENT:
Write a program to design book catalog by using XML and CSS to display tile, author, price and
year of the book.
OUTCOMES:
Students will be able to,
1. Design static webpage using XML.
2. Apply CSS to XML pages.
THEORY:
XML stands for Extensible Markup Language. It is nothing but the text-based markup
language which is derived from Standard Generalized Markup Language(SGML).
XML tags identify the data and are used to store and organize the data, rather than specifying how to
display it like HTML tags, which are used to display the data. XML is not going to replace HTML in the
near future, but it introduces new possibilities by adopting many successful features of HTML.
There are three important characteristics of XML that make it useful in a variety of systems and solutions
● XML is extensible XML allows you to create your own self-descriptive tags, or language, that suits your applicati
● XML carries the data, does not present it XML allows you to store the data irrespective of how it will be presented
●
XML is a public standard XML was developed by an organization called the World Wide Web Consortium (W3C
TECHNOLOGY/TOOL:
The XML document have an XML declaration, but it is optional, and it is written as <? xml version = "1.0" encoding = "U
Where version is nothing but the version of an XML document and UTF specifies the
character encoding used in the document.
Each XML-element needs to be closed either with start or with end elements as shown below
<element>………</element>
An XML document can have only one root element.
<root>
<x>...</x>
<y>...</y>
</root>
XML Attributes:
Using a name/value pair, an attribute specifies a single property for an element. An XML element can have one or more at
http://www.google.com/">XMLTutorial</a>
Here href is the attribute name and http://www.google.com/ is attribute value.
DESIGN/EXECUTION STEPS:
Following steps are used to Create and Execute web applications,
1. Write the XML code in notepad and save with .xml extension.
2. Write the CSS code in notepad and save with .css extension.
3. Import CSS file in XML page.
4. Open XML page in the browser.
CONCLUSION/ANALYSIS:
Hence, we have designed static web pages using XML and CSS.
CODE:
BOOK {
Display: block; margin-left:0;
magin-bottom: 30pt;}
CATALOG {
Width:100%;
background-color: #ffffff;
} TITLE {
Color: ff0000; display:
block; font-size: 20pt;}
AUTHOR {
display: block; color:
#0000ff; font-size: 20pt;}
YEAR, PRICE {
Color:#00000;
Display: block;
Margin-left: 20pt;}
OUTPUT:
Assignment No:4 Date:
Sign: Remark:
ASSIGNMENT 4
TITLE:
Design and develop any suitable web application using HTML, Java Script for form validation.
OBJECTIVES:
1. Understand about basic concepts of JavaScript.
2. Use JavaScript for validation of data.
PROBLEM STATEMENT:
Write a program to design registration form for students by using HTML, CSS& Java Script and
perform following validations: all fields mandatory, phone number and email address validation.
OUTCOMES:
Students will be able to,
1. Design static webpage using HTML.
2. Apply JavaScript to HTML pages for validation of data.
THEORY:
JavaScript is a programming language of HTML as well web. It is preferred for creating network-
centric applications.It is integrated and complimentary with Java. As JavaScript is integrated with
HTML it is very easy to implement. It is open as well as cross-platform.
Advantages:
The advantages of using JavaScript are
It requires less server interaction
Immediate feedback to the visitors
Increased interactivity
Richer interfaces
Validation:
When client enters the all necessary data and press the submit button form validation is done at server
side If data entered by a client is incorrect or missing,the server needs to send all data back to the client
and request for resubmission of form with correct information. This is really a lengthy process which
puts a lot of load(burden) on the server.
So, JavaScript provides a way to validate form's data on the client's side itself before sending it to the
web server. Form validation performs two functions-
Basic Validation –First of all the form must be checked to make sure all the mandatory fields
are filled in. It would require just a loop through each field in the form and check for the data.
Data Format Validation Secondly, the data that is entered must be checked for correct format and its value. The code
DESIGN/EXECUTION STEPS:
Following steps are used to Create and Execute web applications, 1. Write
an HTML code in notepad and save with .html extension.
2. Write the function for validation of email id and phone no and enclosed this function in script.
3. Call this function on ‘onClick’ event of submit button.
4. Open HTML page in the browser.
CONCLUSION/ANALYSIS:
Hence, we applied validate the data using JavaScript.
CODE:
CSS
.one
{
width:400px; height:400px;
background-color:blue;
padding:0px,10px,0px,10px;
margin:auto;
border:solid; border-
color:black;
}
.main{}
JS
<html>
<head>
<title>Javascript</title>
</head>
<body>
<script language="JavaScript">
</script>
</body>
</html>
HTML
<html>
<head>
<titel> </title>
<link href="ass4.css" rel="stylesheet"></link>
<script language="JavaScript">
function validateForm()
{
var x=document.forms["myForm"]
["fname"].value;
if(x=="")
{
alert("Enter the all details. ");
return false;
}
var x=document.forms["myForm"]
["mname"].value;
if(x=="")
{
alert("Enter the all details. ");
return false;
}
var x=document.forms["myForm"]
["lname"].value;
if(x=="")
{
alert("Enter the all details. ");
return false;
}
var y=document.forms["myForm"]
["add"].value;
if(y=="")
{
alert("Enter the all details. ");
return false;
}
document.forms["myForm"].reset()
}
</script>
</head>
<body >
<center>
<div class="main">
<h1>Form Validation Using jQuery</h1>
<div id="form">
<p id="head"></p> <!-- This Segment Displays The Validation Rule -->
</select>
<br><br><br>
Address:<textarea rows="5" cols="25" value="g" required></textarea><br><br><br>
<br><input type ="submit" value="Submit" >
</form>
</div>
</center>
</body>
</html>
OUTPUT:
Assignment No:5 Date:
Sign: Remark:
ASSIGNMENT 5
TITLE:
Design and develop any suitable web application using JSP, Servlet and MySQL(Backend)
OBJECTIVES:
1. Understand about basic concepts of html, CSS
2. Understand the basic functionalities of JSP
3. Having the knowledge of SQL query to create the database
PROBLEM STATEMENTS:
1. Design and Build Student Login Page using JSP, Servlet and MySQL.
2. Design and Build Employee Login Page using JSP, Servlet and MySQL.
.
OUTCOMES: Students will
be able to,
1. Develop a dynamic webpage using JSP, HTML and Servlet.
2. Write a server side java application called Servlet to catch the data sent from client,
process it and store it on database (MySQL).
3. Write a server side java application called JSP to catch form data sent from client and store
it on database (MySQL).
SOFTWARE NEEDED:
1. Any Operating System
2. JDK 7or later
3. Editors; Netbeans/Eclipse
4. Web browser
5. Tomcat 7 or later
THEORY – CONCEPT
Java Server Pages (JSP): It is a server side programming technology that is used to create dynamic
web-based applications. JSP have right to use the complete Java APIs, including the JDBC API to
access the databases.
It is a technology that helps software developers to create dynamic web pages based on HTML,
XML and other document types. It was released in 1999 by Sun Microsystems. It is just like a PHP and
ASP, but it uses the Java programming language.
A JSP element is a type of java servlet that is designed to accomplish the role of a user interface for a
java web application. Web developers write JSPs as text files that combine HTML or XHTML code,
XML elements, and rooted JSP actions and commands.
Using JSP, you can collect input from users through webpage forms, current records from a database
or another source and create web pages dynamically.
JSP tags can be used for different purposes, such as retrieving information from a database or
registering user preferences, accessing JavaBeans components, passing control between pages, and
sharing information between requests, pages etc.
Why we need JSP?
JSP is used for the design of dynamic web page and servlet is used to code the logic that is present i.e.
in the MVC (Model-View-Controller) architecture, the servlet is the controller and the JSP is the
view.
Syntax of JSP:
JSP declarations is used to declare variables and methods as shown below,
<% text %>.
Servlet:
A Servlet is a server side program and written in Java. Servlet is a web component that is deployed on
the server for creating the dynamic web pages. A Java servlet is a Java program that extends the
capabilities of a server. Although servlets can respond to any types of requests, they most commonly
execute applications hosted on Web servers.
DESIGN / EXECUTION STEPS:
Following steps are used to Create and Execute web applications,
1. Design html and jsp files with an extension of.html and .jsp
2. Write database connection page using servlet
3. Set MySQL username, password and database name in database connection page
4. Start the Tomcat Server with port number
5. Open the browser and type localhost:8084
CONCLUSION / ANALYSIS:
Hence, we have performed the dynamic web application using JSP, Servlet and MySQL.
CODE:
Problem Statement: Design and Build Student Login Page using JSP, Servlet and MySQL.
Program:
Index.html Page:
<html>
<head>
<title>Start</title>
<meta charset="UTF-8">
</head>
<body>
background-color:MediumSeaGreen;"></center></a>
<br>
background-color:MediumSeaGreen;"></h2></center></a>
<br><br>
</body>
</html>
Signin.jsp
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<%
pword=request.getParameter("password");
try{
Class.forName("com.mysql.jdbc.Driver");
user);
pst.setString(2,pword);
ResultSet rs=pst.executeQuery();
if(rs.next())
%>
<jsp:forward page="home.jsp"/>
<%
else
%>
<jsp:forward page="Signin.html"/>
<%
catch(Exception e){
System.out.println(e);
%>
</body>
</html>
Signin.html
<html>
<head>
<title>Login Page</title>
<meta charset="UTF-8">
</head>
<body>
background-color:grey;">    
</form>
</body>
</html>
home.jsp
<html>
<head>
<title>Student Information</title>
<%@ page import="java.sql.*" %>
</style>
</head>
<body style="font-family:Veranda,sans-serif;">
<center>
<br><br><br>
<%
try{
Class.forName("com.mysql.jdbc.Driver");
PreparedStatement pst=conn.prepareStatement(sql);
ResultSet rs=pst.executeQuery();
//width=\"100%\">
out.print("<tr style=\"background-color:#ff5b5b;color:white;\">");
out.print("</tr>");
out.print("<tr>");
out.print("<th>Name</th>");
out.print("<th>Address</th>");
out.print("</tr>");
while(rs.next())
out.print("<tr>");
out.print("<td>");
out.print(rs.getString("name"));
out.print("</td>");
out.print("<td>");
out.print(rs.getString("address"));
out.print("</td>");
out.print("</tr>");
catch(Exception e)
System.out.println(e);
%>
<hr/>
<% %>
<hr/>
</body>
</html>
registration.jsp
pageEncoding="ISO-8859-1"%>
<html>
<head>
<title>Sign Up JSP</title>
</head>
<body>
<%
String name=request.getParameter("name");
String gender=request.getParameter("gender");
college=request.getParameter("college"); String
branch=request.getParameter("branch"); String
mobile=request.getParameter("mobile");
String username=request.getParameter("username");
String pass=request.getParameter("password");
System.out.println(name); try{
Class.forName("com.mysql.jdbc.Driver");
PreparedStatement pst=conn.prepareStatement(sql);
pst.setString(1, name);
pst.setString(2, gender);
pst.setString(3, email);
pst.setString(4, college);
pst.setString(5, branch);
pst.setString(6, mobile);
pst.setString(7, username);
pst.setString(8, pass);
pst.executeUpdate();
%>
alert('Registered Successfully!');
<jsp:forward page="Signin.html"/>
<%
catch(Exception e)
System.out.println(e);
%>
</body>
</html>
registration.html
<!DOCTYPE html>
<html>
<head>
<title>Registration</title>
</head>
<body>
<hr />
<br>
<br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
   
<br><br>
<hr />
</form>
</body>
</html>
Assignment No:6 Date:
Sign: Remark:
ASSIGNMENT 6
TITLE:
Add dynamic web application essence using PHP, HTML and MySQL.
OBJECTIVES:
To understand the principles and methodologies of PHP web based applications
development process,
PROBLEM STATEMENT:
Design and develop dynamic web application using PHP and MySQL as a back-end for employee data
with insert, delete, view and update operations.
OUTCOMES:
Students should be able to,
1. Develop web based application using suitable client side and server side web technologies.
2. Develop solution to complex problems using appropriate method,
technologies, frameworks, web services and content management.
THEORY-CONCEPT
1. PHP:
The PHP Hypertext Preprocessor (PHP) began as a little open source venture that advanced as an ever
increasing number of individuals discovered how valuable it was. Rasmus Lerdorf released the
principal form of PHP route in 1994. PHP is a recursive acronym for "PHP: Hypertext Preprocessor".
PHP is a server side scripting dialect that is installed in HTML. It is utilized to oversee dynamic
substance, databases, session following, even form whole internet business locales. It is incorporated
with various prevalent databases, including MySQL, PostgreSQL, Oracle, Sybase, Informix, and
Microsoft SQL Server.
PHP is pleasingly zippy in its execution, particularly when gathered as an Apache module on the Unix
side. The MySQL server, once began, executes even extremely complex questions with colossal outcome
sets in record-setting time.
PHP performs framework capacities, i.e. from documents on a framework it can make, open, read,
compose, and close them. PHP can deal with frames, i.e. accumulate information from records, spare
information to a document; through email you can send information, return information to the client.
To create and run PHP Web pages three fundamental parts should be introduced on your PC
framework.
● Web Server
● PHP Parser
● Database
MySQL:
● MySQL is the most famous Open Source Relational SQL Database
Management System.
● MySQL is outstanding amongst other RDBMS being utilized for creating different online
programming applications. MySQL is created, advertised and upheld by MySQL AB, which
is a Swedish organization. This instructional exercise will give you a fast begin to MySQL
and make you OK with MySQL programming.
What is a Database?
● Different sorts of information stores can likewise be utilized, for example, records on the
document framework or vast hash tables in memory yet information get composing would not
be so quick and simple with those kind of frameworks. These days, we utilize social database
administration frameworks (RDBMS) to store and oversee tremendous volume of
information. This is called social database since every one of the information is put away into
various tables and relations are set up utilizing essential keys or different keys known as
Foreign Keys.
MySQL Database:
MySQL is a quick, simple to-utilize RDBMS being utilized for some little and huge
organizations. MySQL is produced, showcased and upheld by MySQL AB, which is a Swedish
organization. MySQL is winding up so famous as a result of numerous great reasons:
MySQL is discharged under an open-source permit. So you don't have anything to pay to
utilize it.
MySQL is a capable program in its own particular right. It handles a huge subset of the
usefulness of the most costly and intense database bundles.
MySQL utilizes a standard type of the outstanding SQL information dialect.
MySQL takes a shot at many working frameworks and with numerous dialects
including PHP, PERL, C, C++, JAVA, and so forth.
MySQL works rapidly and functions admirably even with extensive
informational indexes.
MySQL is amicable to PHP, the most refreshing dialect for web advancement.
MySQL underpins huge databases, up to 50 million lines or more in a table. The default
document measure restrain for a table is 4GB, yet you can expand this (if your working
framework can deal with it) to a hypothetical utmost of 8 million terabytes (TB). MySQL is
adaptable. The open-source GPL permit enables developers to alter the MySQL programming to
fit their own particular surroundings.
1. Technology is to be used is PHP (PHP Hypertext Preprocessor) and tool XAMPP server is to be
used to execute PHP web application.
2. XAMPP server embeds the PHP, MySQL and phpmyadmin, these three tools must be
required to run php web application.
CONCLUSION/ANALYSIS
In this assignment, we have studied how to design and develop small web application using PHP
script, XAMPP server with apache server and MySQL as backend.
Problem Statement:Design and develop dynamic web application using PHP and MySQL as a
back-end foremployee data with insert, delete, view and update operations.
Code:
db_connect.php
<?php
$conn=mysqli_connect('localhost','root','','assignment6');
if(mysqli_connect_errno())
?>
index.php
<?php
session_start();
if(!isset($_SESSION['email']))
$_SESSION['email']='';
?>
<html>
<head><title>Home Page</title>
<style>
.button {
background-color:white;
color:black; padding:5px;
text-align:center;
padding:15px 30px;
transition-duration:0.4s;
border-radius:4px;
font-size:25px;
.top {
background-color:#ff5b5b;
color:white;
padding:5px; text-
align:center;
padding:15px 30px;
font-size:25px;
float:left; border:none;
width:50%;
</style>
</head>
<body style="font-family:Veranda,sans-serif;">
<div class="top_bar">
</div>
<center>
</center>
</body>
</html>
s_in.php
<html>
<style>
.header { margin-
top:5px;
margin-bottom:10%;
padding:8px;
font-size:30px; text-
align:center;
.top {
background-color:#ff5b5b;
color:white;
text-align:center;
padding:15px 30px;
font-size:25px;
float:left; border:none;
width:50%;
margin-bottom:10px;
.button {
background-color:white;
color:black;
text-align:center;
padding:10px 15px;
transition-duration:0.4s;
border-radius:4px;
font-size:20px;
</style>
</head>
<body style="font-family:Veranda,sans-serif;">
<div class="top_bar">
</div>
<center>
<table>
</table>
<br><br>
</form>
</center>
</body>
</html>
login_validate.php
<?php
require 'db_connect.php';
session_start();
$email=$_POST['email'];
$pword=$_POST['pword'];
$result=mysqli_query($conn,$query);
if(mysqli_num_rows($result)>0)
$_SESSION['email']=$email;
?>
<script>location.href="s_info.php";</script>
<?php
else {
?>
location.href="s_in.php";
</script>
<?php
?>
s_up.php
<html>
<style>
.top {
background-color:#ff5b5b;
color:white;
text-align:center;
padding:15px 30px;
font-size:25px;
float:left; border:none;
width:50%;
margin-bottom:10px;
.header { margin-
top:5px;
margin-bottom:5%;
padding:8px;
font-size:30px; text-
align:center;
.button {
background-color:white;
color:black; padding:10px
15px;
text-align:center; border-
radius:4px; transition-
duration:0.4s; font-
size:20px;
</style>
</head>
<body style="font-family:Veranda,sans-serif;">
<div class="top_bar">
</div>
<center>
<div style="clear:left;"class="header">Sign-up for a new account</div>
</center>
<div>
<center>
<table>
</table>
</center>
<br><br>
<center>
<button type="reset" class="button reset">Reset</button>
</center>
</form>
</div>
</body>
</html>
reg_user.php
<?php
require 'db_connect.php';
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$gender=$_POST['gender'];
$age=$_POST['age'];
$mno=$_POST['mno'];
$add=$_POST['add'];
$email=$_POST['email'];
$pword=$_POST['pword'];
$query="insert into
registration_detailsvalues('$fname','$lname','$gender','$age','$mno','$add','$email','$pword')";
if(mysqli_query($conn,$query))
?>
</script>
<?php
}
else {
?>
s_info.php
<?php
require 'db_connect.php';
session_start();
if($_SESSION['email']=='')
?>
location.href="s_in.php";</script>
<?php
else{
$result=mysqli_query($conn,$query);
$info=mysqli_fetch_all($result,MYSQLI_ASSOC);
mysqli_free_result($result); mysqli_close($conn);
?>
<html>
<head><title>Student Information</title>
<style>
.header { margin-
top:5px;
margin-bottom:5%;
padding:8px;
font-size:30px; text-
align:center;
.button {
background-color:white;
color:black;
text-align:center;
padding:10px 15px;
transition-duration:0.4s;
border-radius:4px;
font-size:20px;
tr:nth-child(even) {background-color:#efefef;}
.tablebtn:link, .tablebtn:visited
{ background-color: white;
color: black;
padding: 5px 5px; text-
decoration: none;
display: inline-block;
transition-duration:0.4s;
border-radius:4px;
</style>
</head>
<body style="font-family:Veranda,sans-serif;">
<center>
<br><br><br>
<table width="100%">
<tr>
</tr>
<tr style="background-color:#ff5b5b;color:white;">
<th>Roll No.</th>
<th>First Name</th>
<th>Last Name</th>
<th>Gender</th>
<th>Mobile No.</th>
<th>Action</th>
</tr>
<td>
class="tablebtn">Update</a>
</td>
</tr>
<?php }?>
</table>
</center>
</body>
</html>
insert.php
<?php
session_start();
if($_SESSION['email']=='')
?>
?>
<html>
<style>
.header { margin-
top:5px;
margin-bottom:5%;
#008CBA; padding:8px;
font-size:30px; text-
align:center;
.button {
background-color:white;
color:black;
text-align:center;
padding:10px 15px;
transition-duration:0.4s;
border-radius:4px;
font-size:20px;
}
</style>
</head>
<body style="font-family:Veranda,sans-serif;">
<center>
<br><br><br>
<table>
</table>
<br><br>
<button type="reset" name="reset" class="button reset">Reset</button>
</form>
</center>
</body>
</html>
insert_rec.php
<?php
require 'db_connect.php';
session_start();
if($_SESSION['email']=='')
?>
location.href="s_in.php";</script>
<?php
else{
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$gender=$_POST['gender'];
$mno=$_POST['mno'];
if(mysqli_query($conn,$query))
?>
<script>alert('Inserted Successfully!');
location.href="s_info.php";
</script>
<?php
else {
else {
?>
location.href="insert.php";</script>
<?php
?>
update.php
<?php
require 'db_connect.php';
session_start();
if($_SESSION['email']=='')
?>
location.href="s_in.php";</script>
<?php
else{
$rollno=$_GET['rollno'];
$result=mysqli_query($conn,$query);
$info=mysqli_fetch_assoc($result);
?>
<html>
<style>
.header { margin-
top:5px;
margin-bottom:5%;
padding:8px;
font-size:30px; text-
align:center;
.button {
background-color:white;
color:black;
text-align:center;
padding:10px 15px;
transition-duration:0.4s;
border-radius:4px;
font-size:20px;
</style>
</head>
<body style="font-family:Veranda,sans-serif;">
<center>
<br><br><br>
<table>
</table>
<br><br>
</form>
</center>
</body>
</html>
update_rec.php
<?php
require 'db_connect.php';
session_start();
if($_SESSION['email']=='')
?>
<?php
else {
$rollno=$_GET['rollno'];
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$gender=$_POST['gender'];
$mno=$_POST['mno'];
if(mysqli_query($conn,$query))
?>
<script>alert('Updated Successfully!');
location.href="s_info.php";
</script>
<?php
else {
else {
?>
<?php
?>
delete.php
<?php
require 'db_connect.php';
session_start();
if($_SESSION['email']=='')
?>
location.href="s_in.php";</script>
<?php
else {
$rollno=$_GET['rollno'];
if(mysqli_query($conn,$query))
?>
<script>alert('Deleted Successfully!');
location.href="s_info.php";
</script>
<?php
else {
?>
logout.php
<?php session_start();
session_destroy();
?>
<script>location.href="index.php";</script>
Output:
Assignment No:7 Date:
Sign: Remark:
ASSIGNMENT 7
TITLE:
Add dynamic web application essence using PHP, AJAX and MySQL.
OBJECTIVES:
To understand the principles and methodologies of web based applications
development process.
PROBLEM STATEMENT:
Design and develop dynamic web application using PHP, AJAX and MySQL as a back-end for
employee data with insert and view operations.
OUTCOMES:
Students should be able to,
1. Develop web based application using suitable client side and server side web technologies.
2. Develop solution to complex problems using appropriate method,
technologies, frameworks, web services and content management.
THEORY-CONCEPT:
AJAX remains for Asynchronous JavaScript and XML. AJAX is another procedure for making better,
speedier, and more intelligent dynamic web applications with the assistance of XML, HTML, CSS, and
Java Script. Ajax utilizes XHTML for content, CSS for introduction, alongside Document Object
Model and JavaScript for dynamic substance show.
Customary web applications transmit data to and from the server utilizing
synchronous solicitations.
It implies you round out a frame, hit submit, and get coordinated to another page with new data from
the server. With AJAX, when you hit submit, JavaScript will influence a demand to the server, to
decipher the outcomes, and refresh the present screen. In the purest sense, the client could never
realize that anything was even transmitted to the server.
AJAX instructional exercise covers ideas and cases of AJAX innovation for apprentices and
experts.
AJAX is an acronym for Asynchronous JavaScript and XML. It is a gathering of between related
innovations like JavaScript, DOM, XML, HTML, CSS and so forth.
AJAX enables you to send and get information nonconcurrently without reloading the page. So it is
quick.
AJAX enables you to send just essential data to the server not the whole page. So just profitable
information from the customer side is steered to the server side. It makes your application intuitive and
quicker.
AJAX speaks with the server utilizing XML HttpRequest question. How about we endeavor to
comprehend the stream of ajax or how ajax functions by the picture showed beneath.
TECHNOLOGY/TOOL:
AJAX, PHP and MySQL
CONCLUSION/ANALYSIS:
In this assignment, we have studied how to design and develop small web application using PHP, java
script, ajax, XAMPP server with apache server and MySQL as backend.
CODE:
Problem Statement:Design and develop dynamic web application using PHP, AJAX and MySQL as a
backend for employee data with insert and view operations.
Code:
● getvalues.php
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<?php
$role=$_GET['p'];
if($role==1)
$sel_role="Developer";
} else if($role==2)
$sel_role="Tester";
} else if($role==3)
$sel_role="Technician";
} else if($role==4)
$sel_role="Salesperson";
}
$conn=mysqli_connect("localhost","root","","ajax");
<tr style='background-color:#ff5b5b;color:white;'>
<th>id</th>
<th>name</th>
<th>salary</th>
<th>email</th>
</tr>";
while ($row=mysqli_fetch_array($result))
echo "<tr>";
echo "<td>".$row['id']."</td>";
echo "<td>".$row['name']."</td>";
echo "<td>".$row['salary']."</td>";
echo "<td>".$row['email']."</td>";
echo "</tr>";
} echo "</table>";
?>
</body>
</html>
● view_records.php
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript">
functionshowUser(role_val)
xmlhttp.onreadystatechange=function(){
if(this.readyState==4 &&this.status==200)
console.log('Result:'+this.responseText);
document.getElementById("table1").innerHTML=this.responseText;
};
xmlhttp.open("GET","getvalues.php?p="+role_val,true);
xmlhttp.send();
</script>
<style type="text/css">
.header { margin-
top:3%;
margin-bottom:5%;
padding:8px;
font-size:30px; text-
align:center;
}
table {
text-align:center;
border-collapse:collapse;
font-size:20px;
tr:nth-child(even) {background-color:#efefef;}
select {
width:130px;
height:30px;
</style>
</head>
<body>
<center>
<form>
<div>
value="1">Developer</option> <option
value="2">Tester</option>
<option value="3">Technician</option>
<option value="4">Salesperson</option>
</select>
</div>
</form>
<br><br><br>
<div id="table1">
</div>
</center>
</body>
</html>
Output:
Assignment No:8 Date:
Sign: Remark:
ASSINMENT 8
TITLE:
Design and develop any web application using Struts framework.
OBJECTIVES:
1. To impart the efficient and available client side and server side technologies.
2. To implement the communication between computing nodes using client side and server
side technologies.
3. To design and implement the web services with content management.
PROBLEM STATEMENT:
Create a login module for the web application using struts framework.
OUTCOMES:
Students should be able to,
1. Implement the effective client side and server side technologies using struts framework.
2. Solve the complex problem of development using MVC framework.
THEORY:
The frameworks plays a vital role in industries for manageable and well designed application
development as well as enterprise application development. The core of the Struts framework is a
flexible control layer based on standard technologies like Java Servlets, JavaBeans, Resource
Bundles, and XML, as well as various Jakarta Commons packages. Struts encourages application
architectures based on the Model 2 approach, a variation of the classic Model-View-
Controller(MVC).
Struts gives its own particular Controller segment and incorporates with different advancements to give
the Model and the View. For the Model, Struts can collaborate with standard information get to
advances, as JDBC and EJB, and also most any outsider bundles, as Hibernate, iBATIS, or Object
Relational Bridge. For the View, Struts functions admirably with Java Server Pages, including JSTL
and JSF, and in addition Velocity Templates, XSLT, and other introduction frameworks.
What is Struts?
Struts is a framework that advances the utilization of the Model-View-Controller engineering for
planning substantial scale applications. The structure incorporates an arrangement of custom label
libraries and their related Java classes, alongside different utility classes. The most intense part of the
Struts system is its help for making and preparing electronic structures.
Struts Tags
Common Attributes
Almost all tags provided by the Struts framework use the following attributes:
CONCLUSION/ANALYSIS:
Hence we have successfully tested the Struts framework and tested the results.
CODE:
Problem Statement: Create a login module for the web application using struts framework.
Program:
login.jsp
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>Login</h1>
type="submit" value="Login"/>
</form>
</body>
</html>
success.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>Success Page</h1>
</body>
</html>
failure.jsp
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>Failure page</h1>
</body>
</html>
loginbean.java
package com.myapp.struts;
import javax.servlet.http.HttpServletRequest;
org.apache.struts.action.ActionMapping; import
org.apache.struts.action.ActionMessage;
/**
* @author hp
*/
{ return uname;
{ this.uname = uname;
{ return upass;
}
public void setUpass(String upass)
{ this.upass = upass;
public loginbean()
{ super();
return errors;
loginform.java
package com.myapp.struts;
javax.servlet.http.HttpServletResponse; import
org.apache.struts.action.ActionForm; import
org.apache.struts.action.ActionForward; import
org.apache.struts.action.ActionMapping;
public class loginform extends org.apache.struts.action.Action {
@Override
Exception {
loginbean lb = (loginbean)form;
return mapping.findForward(SUCCESS);
else
return mapping.findForward(FAILURE);
structs-config.xml
"http://jakarta.apache.org/struts/dtds/struts-config_1_3.dtd">
<struts-config>
<form-beans>
</form-beans>
<global-exceptions>
</global-exceptions>
<global-forwards>
</global-forwards>
<action-mappings>
<action path="/Welcome"
forward="/welcomeStruts.jsp"/> </action-mappings>
<controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>
<message-resources parameter="com/myapp/struts/ApplicationResource"/>
</plug-in>
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property
property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>
</struts-config>
web.xml
<servlet>
<servlet-name>action</servlet-name> <servlet-
class>org.apache.struts.action.ActionServlet</servlet-class> <init-
param>
<param-name>config</param-name> <param-
value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout> 30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
<jsp-config>
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri> <taglib-
location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri> <taglib-
location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri> <taglib-
location>/WEB-INF/struts-nested.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri> <taglib-
location>/WEB-INF/struts-tiles.tld</taglib-location>
</taglib>
</jsp-config>
</web-app>
Output:
Assignment No:9 Date:
Sign: Remark:
ASSIGNMENT 9
TITLE:
Design and develop any web application using AngularJS.
OBJECTIVES:
1. Understand the design of single-page applications and how AngularJS facilitates their
Development.
2. Properly separate the model, view, and controller layers of your application and
implement them using AngularJS.
3. Master AngularJS expressions, filters, and scopes
4. Build Angular forms
5. Elegantly implement Ajax in your AngularJS applications
6. Write AngularJS directives
PROBLEM STATEMENT:
Create an application for Bill Payment Record using AngularJS
OUTCOMES:
Students can able to,
1. Implement the effective client side implementation.
2. Solve the complex problem of development using MVC framework.
THEORY-CONCEPT:
AngularJS is an open-source web application framework. It was initially created in 2009 by MiskoHevery
and Adam Abrons. It is presently kept up by Google. Its most recent adaptation is 1.2.21. "AngularJS is
an auxiliary system for dynamic web applications. It gives you a chance to utilize HTML as your layout
dialect and gives you a chance to stretch out HTML's linguistic structure to express your application parts
plainly and compactly. Its information official and reliance infusion take out a significant part of the code
you as of now need to compose. Also, everything occurs inside the program, making it a perfect band
together with any server innovation".
General Features
AngularJS is a productive system that can make Rich Internet Applications (RIA).
AngularJS gives designers a choices to compose customer side applications
utilizing JavaScript in a spotless Model View Controller (MVC) way.
Applications written in AngularJS are cross-program agreeable. AngularJS consequently handles
JavaScript code reasonable for every program.
AngularJS is open source, totally free, and utilized by a great many engineers the world
over. It is authorized under the Apache permit version2.0.
By and large, AngularJS is a system to assemble expansive scale, elite, and simple tokeep
up web applications.
Core Features:
Advantages of AngularJS
It gives the ability to make Single Page Application in a spotless and viable way.
It gives information restricting ability to HTML. Along these lines, it gives client a rich and
responsive experience.
AngularJS code is unit testable.
AngularJS utilizations reliance infusion and make utilization of partition of concerns.
AngularJS gives reusable segments.
With AngularJS, the engineers can accomplish greater usefulness with short code.
In AngularJS, sees are unadulterated html pages, and controllers written in JavaScript do the
business handling.
CONCLUSION/ANALYSIS:
With the help of this assignment it is helpful to understand features of AngularJS. MVC
model structure and its use in advanced web programming is studied.
CODE:
Problem Statement: Create an application for Bill Payment Record using AngularJS.
Program:
<html>
<head>
<script src="angular.js"></script>
</head>
<body>
<hr><br>
<hr>
<br><br>
<tr>
<th>Description</th>
<th>Qty</th>
<th>Cost</th>
<th>Total</th>
<th>Remove</th>
</tr>
</tr>
<tr>
<td></td>
<td>Total:</td>
</tr>
</table>
</center>
</div>
<script>
var app=angular.module('myapp',[]);
app.controller('CartForm', function($scope)
$scope.cart =
$scope.addItem = function()
$scope.removeItem = function(index)
$scope.cart.items.splice(index, 1);
$scope.total = function()
var total = 0;
angular.forEach($scope.cart.items, function(item)
})
return total;
}
);
</script>
</body>
</html>
Output:
Assignment No: 10 Date:
Sign: Remark:
ASSIGNMENT 10
Title:
Design and implement a business interface with necessary business logic for any web
application using EJB.
OBJECTIVES:
To understand Enterprise Java Bean for web application.
PROBLEM STATEMENT:
Design and implement the web application logic for deposit and withdraw amount
transactions using EJB.
OUTCOMES:
Students should be able to,
3. Develop web based application using EJB.
4. Develop application to understand amount transactions in business.
Problem Statement:
Design and implement the web application logic for deposit and withdraw amount
transactions using EJB.
THEORY-CONCEPT
2. Message Driven Bean: Like Session Bean, it contains the business logic but it is invoked by passing message.
3. Entity Bean: It summarizes the state that can be remained in the database. It is deprecated. Now, it is replaced with JPA
(Java Persistent API). There are two types of entity bean:
CONCLUSION/ANALYSIS
In this assignment,we have studied how to implement the web application logic for amount
transactions using EJB.
Code:
Index.html
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<h3>Select option</h3>
</form>
</body>
transact.java
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
response.setContentType("text/html;charset=UTF-8");
try {
String selectdType=request.getParameter("transact");
int amount=Integer.ParseInt(request.getParameter(t1));
if(selectdType.equals("deposite")){
bankTransact.deposite(amount);
if(selectdType.equals("withdraw")){
int amt=bankTransact.withdraw(amount);
}
}
try{
return(BankTransactLocal)c.Lookup("java.global/Bank/Bank-ejb/BankTransact!
Bankexamp.Bank/Bank-ejb/BankTransactLocal")
Logger.getLogger(getClass().getName().log(Level.SEVERE,"exception caught",ne))
BankTransact.java
package bankexamp;
inport javax.ejb.Statful;
@Stateful
@override
balance=balance+amount;
return balance;
@override
balance=balance-amount
return balance;
Output: