19
WEB ENGINEERING (CS-802) LAB - MANUAL Student Name: - ……………………….. Enrollment No: - ………………………. Branch/Year/Semester:-………………. Affiliated to Rajiv Gandhi Prodyogiki Vishwavidyalaya Bhopal (MP) MAHAKAL INSTITUTE OF TECHNOLOGY BEHIND AIR STRIP UJJAIN (MP) AICTE Approved, NBA Accredited, ISO 9001-2000 Certified Department of Computer Science & Engineering

WEB ENGINEERING Mannual.pdf

Embed Size (px)

DESCRIPTION

Uploaded from Google Docs

Citation preview

Page 1: WEB ENGINEERING Mannual.pdf

WEB ENGINEERING(CS-802)

LAB - MANUAL

Student Name: - ………………………..

Enrollment No: - ……………………….

Branch/Year/Semester:-……………….

Affiliated to Rajiv Gandhi Prodyogiki Vishwavidyalaya Bhopal(MP)

MAHAKAL INSTITUTE OFTECHNOLOGY

BEHIND AIR STRIP UJJAIN (MP)AICTE Approved, NBA Accredited, ISO 9001-2000 Certified

Department ofComputer Science & Engineering

Page 2: WEB ENGINEERING Mannual.pdf

INDEX

S.No Name of Algorithm Date Sign Remark

1 To Study Web servers and web Browsers

2 Write the introduction of ASP, PHP and XML

3 Create a web page purely in HTML code

4 Create a web page to show application of CSS file

5 Study of JavaScript and applying java script to validateform

6 Create a web page using HTML, java script, CSS file

7 Create a web page to show application of form controls

8 a) Write a code in ASP to format the text withHTML tags.

b) Write a code to reverse the string.c) Write a code to check is user is connected or not

9 Create an XML document template to describe the resultof student in an examination.

10 a. Write the code in PHP by using Loop statementsany 2

b.Write the code in PHP using Mathematicaloperations, String functions (any one).

Page 3: WEB ENGINEERING Mannual.pdf

Lab manualTotal number of Experiments: 10

S.No Name of Algorithm Days needed tocomplete

1 To Study Web servers and web Browsers

2 a) Write the introduction of ASPb) What are the strengths of XML technologyc) Write short note on conditional statement and Iterations in PHP.d) What is the file extension of PERL, write the code using FOR and

WHILE loop.e) What CGI scripts are?

3 Create a web page purely in HTML code

4 Create a web page to show application of CSS file

5 Study of JavaScript and applying java script to validate form

6 Create a web page using HTML, java script, CSS file

7 Create a web page to show application of form controls

8 a) Write a code in ASP to format the text with HTML tags.b) Write a code to reverse the string.c) Write a code to check is user is connected or not

9 Create an XML document template to describe the result of student in anexamination.

10 1) Write the code in PHP by using Loop statements any 22) Write the code in PHP using Mathematical operations, String

functions (any one).

Distribution of lab hours: 1Hour 40 Min.Explanation of experiment: 15 Min.Performance of experiment: 55 Min.File checking: 10 Min.Attendance: 05 Min.

Page 4: WEB ENGINEERING Mannual.pdf

PROGRAM NO: - 1

Unit/Topic: Web Server and Browser

PROBLEM DEFINITION:Study of web server and web Browser.

OBJECTIVE:To understand working of web server and browser.

THEORY:

Web Server:A web server can mean two things - a computer on which a web site is hosted and a program thatruns on such a computer. So the term web server refers to both hardware and software. We'lllook at each of these individually. A web site is a collection of web pages. And web pages aredigital files, typically written using HyperText Markup Language (HTML). For a web site to beavailable to everyone in the world at all times, it need to be stored or "hosted" on a computer thatis connected to the internet. Such a computer is known as a web Server.

Hardware:

There are several requirements for a Server computer - it needs to be fast, have a large storagecapacity hard disk and lots of RAM. But the most important is having a permanent internetaddress also known as an I.P. (Internet protocol) address

Software:

A web server program is software that runs on the web site hosting Server computer. Its mainpurpose is to serve web pages; which means it waits for requests from web browsers (also knownas clients) and responds by sending the required data back.

Page 5: WEB ENGINEERING Mannual.pdf

Role of Web Server:

Web servers - the computer or the program - have a vital role on the Internet. The Servermachine hosts the web site while the server program helps deliver the web pages and theirassociated files like images and flash movies.The process of loading a web site/page in a web browser starts with the user either entering theURL in the address bar or clicking on a link. You should know that each web page has aunique address (or URL) on the internet; which means the same page cannot exist in two places.

The browser now needs to send out a request for the web page. Behind the scenes, the URL ofthe requested web page is resolved into an I.P. address, which in English means, converted toan I.P. addresses - something that computers understand. The I.P. address points to the locationof the web site host and the request is forwarded to Server computer and passed on to the serversoftware.The server software now takes up and hunts for the requested web page on the hard disk. Onfinding the file, it sends back a response and the web page file to the browser which then startsdisplaying the page. A typical web page not only has text but also embedded multimediaelements like images and Flash animation. These "extra" files are separate from the actual webpage and need to be sent one by one for the browser to display the web page correctly. ONLYthe web browser determines how a web page is displayed; the web server has no control overthis. The job of a web server ends once it processes the request from a browser and sends therequired information.

Page 6: WEB ENGINEERING Mannual.pdf

Web Browser:

A Web browser is a software application for retrieving, presenting, and traversing informationresources on the World Wide Web. An information resource is identified by a Uniform ResourceIdentifier (URI) and may be a web page, image, video, or other piece of content. Hyperlinkspresent in resources enable users to easily navigate their browsers to related resources.

Web Browser Features:

ActiveX: ActiveX is a technology used by Microsoft Internet Explorer on Microsoft Windowssystems. ActiveX allows applications or parts of applications to be utilized by the web browser.A web page can use ActiveX components that may already reside on a Windows system, or a sitemay provide the component as a downloadable object. This gives extra functionality totraditional web browsing, but may also introduce more severe vulnerabilities if not properlyimplemented.

Plug-ins: Plug-ins are applications intended for use in the web browser. Netscape has developedthe NPAPI standard for developing plug-ins, but this standard is used by multiple web browsers,including Mozilla Firefox and Safari. Plug-ins are similar to ActiveX controls but cannot beexecuted outside of a web browser. Adobe Flash is an example of an application that is availableas a plug-in.

Cookies: Cookies are files placed on your system to store data for specific web sites. A cookiecan contain any information that a web site is designed to place in it. Cookies may containinformation about the sites you visited, or may even contain credentials for accessing the site.Cookies are designed to be readable only by the web site that created the cookie. Session cookies

Page 7: WEB ENGINEERING Mannual.pdf

are cleared when the browser is closed, and persistent cookies will remain on the computer untilthe specified expiration date is reached.

JavaScript: JavaScript is a scripting language that is used to make web sites more interactive.There are specifications in the JavaScript standard that restrict certain features such as accessinglocal files.

INPUT SET:

OUTPUT SET:

NOTES:

NAME OF FACULTY:

SIGNATURE:

DATE:

Page 8: WEB ENGINEERING Mannual.pdf

PROGRAM NO: - 2

Unit/Topic: Web ApplicationsPROBLEM DEFINITION:a) Write the introduction of ASPb) What are the strengths of XML technologyc) Write short note on conditional statement and Iterations in PHP.d) What is the file extension of PERL, write the code using FOR and WHILE loop.e) What CGI scripts are?

OBJECTIVE:To understand basics technologies for Web Applications

INPUT SET:

OUTPUT SET:

NOTES:

NAME OF FACULTY:

SIGNATURE:

DATE:

Page 9: WEB ENGINEERING Mannual.pdf

PROGRAM NO: - 3Unit/Topic: HTML

PROBLEM DEFINITION:To create a web page purely in HTML .

OBJECTIVE:To understand basic and use of HTML tags.

INPUT SET:

OUTPUT SET:

NOTES:

NAME OF FACULTY:

SIGNATURE:

DATE:

Page 10: WEB ENGINEERING Mannual.pdf

PROGRAM NO: - 4

Unit/Topic: Cascading style sheetPROBLEM DEFINITION:To create a web page to show application of CSS file

OBJECTIVE:To understand concept of CSS (Cascading style sheet)

INPUT SET:

OUTPUT SET:

NOTES:

NAME OF FACULTY:

SIGNATURE:

DATE:

Page 11: WEB ENGINEERING Mannual.pdf

PROGRAM NO: - 5Unit/Topic: JavaScript

PROBLEM DEFINITION:Study of JavaScript and applying java script to validate form

OBJECTIVE:Study of java script and validation.

THEORY:What is JavaScript?

JavaScript gives HTML designers a programming tool - HTML authors are normallynot programmers, but JavaScript is a scripting language with a very simple syntax!Almost anyone can put small "snippets" of code into their HTML pages

JavaScript can put dynamic text into an HTML page - A JavaScript statement likethis: document.write("<h1>" + name + "</h1>") can write a variable text into an HTMLpage

JavaScript can react to events - A JavaScript can be set to execute when somethinghappens, like when a page has finished loading or when a user clicks on an HTMLelement

JavaScript can read and write HTML elements - A JavaScript can read and change thecontent of an HTML element

JavaScript can be used to validate data - A JavaScript can be used to validate formdata before it is submitted to a server. This saves the server from extra processing

JavaScript can be used to detect the visitor's browser - A JavaScript can be used todetect the visitor's browser, and - depending on the browser - load another pagespecifically designed for that browser

JavaScript can be used to create cookies - A JavaScript can be used to store andretrieve information on the visitor's computer

Interpreted language -JavaScript is an interpreted language (means that scripts executewithout preliminary compilation)

To insert a JavaScript into an HTML page, we use the <script> tag. Inside the <script> tagwe use the type attribute to define the scripting language.So, the <scripttype="text/javascript"> and </script> tells where the JavaScript starts and ends:

<html><body><script type="text/javascript">….</script></body></html>

Page 12: WEB ENGINEERING Mannual.pdf

JavaScript Functions

To keep the browser from executing a script when the page loads, you can put your script into afunction. A function contains code that will be executed by an event or by a call to the function.You may call a function from anywhere within a page (or even from other pages if the functionis embedded in an external .js file).

Functions can be defined both in the <head> and in the <body> section of a document. However,to assure that a function is read/loaded by the browser before it is called, it could be wise to putfunctions in the <head> section.

<script type="text/javascript">function displaymessage(){alert("Hello World!");}</script>

Events

By using JavaScript, we have the ability to create dynamic web pages. Events are actions thatcan be detected by JavaScript. Every element on a web page has certain events which can triggera JavaScript. For example, we can use the onClick event of a button element to indicate that afunction will run when a user clicks on the button. We define the events in the HTML tags

The <form> tag supports the following event attributes:

Attribute Descriptiononclick Script to be run on a mouse clickondblclick Script to be run on a mouse double-clickonmousedown Script to be run when mouse button is pressedonmousemove Script to be run when mouse pointer movesonmouseout Script to be run when mouse pointer moves out of an elementonmouseover Script to be run when mouse pointer moves over an elementonmouseup Script to be run when mouse button is releasedonkeydown Script to be run when a key is pressedonkeypress Script to be run when a key is pressed and releasedonkeyup Script to be run when a key is releasedonreset Script to be run when a form is resetonsubmit Script to be run when a form is submitted

Page 13: WEB ENGINEERING Mannual.pdf

JavaScript Form Validation

JavaScript can be used to validate data in HTML forms before sending off the content to aserver. Form data that typically are checked by a JavaScript could be:

has the user left required fields empty? has the user entered a valid e-mail address? has the user entered a valid date? has the user entered text in a numeric field?

Browser Detection

Almost everything in this tutorial works on all JavaScript-enabled browsers. However, there aresome things that just don't work on certain browsers - especially on older browsers. So,sometimes it can be very useful to detect the visitor's browser, and then serve up the appropriateinformation.

The best way to do this is to make your web pages smart enough to look one way to somebrowsers and another way to other browsers. The Navigator object contains information aboutthe visitor's browser name, version, and more.The Navigator object contains all informationabout the visitor's browser. We are going to look at two properties of the Navigator object:

appName - holds the name of the browser appVersion - holds, among other things, the version of the browser

<script type="text/javascript">var browser=navigator.appName;var b_version=navigator.appVersion;var version=parseFloat(b_version);

document.write("Browser name: "+ browser);document.write("<br />");document.write("Browser version: "+ version);</script>

Page 14: WEB ENGINEERING Mannual.pdf

INPUT SET:

OUTPUT SET:

NOTES:

NAME OF FACULTY:

SIGNATURE:

DATE:

Page 15: WEB ENGINEERING Mannual.pdf

PROGRAM NO: - 6Unit/Topic: Web Page

PROBLEM DEFINITION:To create a web page using HTML, java script, CSS file

OBJECTIVE:Implementation of web page using HTML, java script and CSS

INPUT SET:

OUTPUT SET:

NOTES:

NAME OF FACULTY:

SIGNATURE:

DATE:

Page 16: WEB ENGINEERING Mannual.pdf

PROGRAM NO: - 7Unit/Topic: Form Controls

PROBLEM DEFINITION:To create a web page to show application of form controls

OBJECTIVE:Implementation form controls in HTML page.

INPUT SET:

OUTPUT SET:

NOTES:

NAME OF FACULTY:

SIGNATURE:

DATE:

Page 17: WEB ENGINEERING Mannual.pdf

PROGRAM NO: - 8Unit/Topic: ASP

PROBLEM DEFINITION:a) Write a code in ASP to format the text with HTML tags.b) Write a code to reverse the string.c) Interact with a user in a form that uses get and post methodd) Return session id number

OBJECTIVE:To understand the code of ASP by using format code, get and post method.

INPUT SET:

OUTPUT SET:

NOTES:

NAME OF FACULTY:

SIGNATURE:

DATE:

Page 18: WEB ENGINEERING Mannual.pdf

PROGRAM NO: - 9Unit/Topic: XML

PROBLEM DEFINITION:a) Create an XML document template to describe the result of student in an examination.

OBJECTIVE:

To understand the creation of XML document.

INPUT SET:

OUTPUT SET:

NOTES:

NAME OF FACULTY:

SIGNATURE:

DATE:

Page 19: WEB ENGINEERING Mannual.pdf

PROGRAM NO: - 10Unit/Topic: PHP

PROBLEM DEFINITION:1) Write the code in PHP by using Loop statements.

2) Write the code in PHP using Mathematical operations, String functions (any one).

OBJECTIVE:Understanding concept of PHP.

INPUT SET:

OUTPUT SET:

NOTES:

NAME OF FACULTY:

SIGNATURE:

DATE: