You are on page 1of 521

WEB PROGRAMMING

Subject Code 3160713

ster - V (Computer Engineering/ Computer Science & Engineering) Professional Elective I1

OCopyright with Author


All publishing rights (printed and ebook
version) reserved with Technical Publications. No part of this book
should be reproduced in any form, Electronic,
Mechanical, Photocopy or any iformation storage and
retrieval system without prior permission in
writing, from Technical Publications, Pune.

Published by:
TEECHNICEAT
PUBLICATIONS
Amit
Pune
Residency, Office No.1, 412, Shaniwar Peth,
411030, M.S. INDIA Ph.: +91-020-24495496/97
Up-Thnsd or Knod Email:
sales@technicalpublications.org Website: www.technicalpublications.org

Printer
Yogirej Printers &Binders
S. No. 10/1A,
Ghule Industrial Estate, Nanded
Tal. Haveli, Dist.
Village Road,
Pune - 411041.
ISBN 978-93-90450-92-3

7893904 50923
Course 18
9789390450923 [1
(it)
PREFACE
importance ot web Programming is well known in
The
various engineering fields.
verwhelming respo
eenhelming ponse to my books on varlous
subjects inspired me to write this book. The
his structured to cover the Rey aspects of the subject Web Programming.
The book uses plain. lucid
language to explain fundamentals of this
arides logical method of explaining various
subject. The book
provid
complicated concepts and stepwise methods
n explain the important toplcs. Each chapter is well supported with
necessary illustrations.
nractical examples and solved problems. All the
prad chapters in the book are arranged in a
that
proper sequence permits each topic to build upon earlier studies. All care has been
aben to make students comtortable in understanding the basic concepts of the subject.
Representative questions have been added at the end of each
section to help the
students in picking important points from that section.
The book not only the entire scope of the subject but
covers
explains the philosophy of
the subject. This makes the understanding of this
subject more clear and makes it more
interesting. The book will be very useful not only to the students but also to the subject
teachers. The students have to omit nothing and possibly have to cover nothing more.
I wish to express my profound thanks to all those who helped in making this book a
Teality. Much needed moral support and encouragement is provided on numerous
Occasions by my whole family. I wish to thank the Publisher and the entire team of
Technical Publications who have taken immense pain to get this book in time with quality
printing
Any suggestion for the improvement of the book will be acknowledged and well
appreciated.

Anthor
A.A. Duntambekas

Deduatd to jed.
(1ii)
SYLLABUS
Web Programming 3160713
Examinatlon Marks
Credits
TheoryMarks Practlcal Marks Total Marks
C
ESE(E) PA(M) ESE () PA(D
70 30 30 20 150

. Introduction to WEB
Basics of WWw. HTTP protocol. Client Server architecture. Introduction to web server installation and
configuration
Web Design
Concepts of effective web design. Web design issues including Browser. Bandwidth and Cache. Display
resolution. Look and Feel of the Website. Page Layout and linking. User centric design. Sitemap. Planning and
publishing website. Designing effective navigation (Chapters 1. 2
2. Basics of HTML and CSS
Structure of HTML page. HTML tags for data formatting. tables. links, images, meta tags. frames. html form
tags. media. APls. HTMILS tags and validation.
Need for CSS, Syntax and structure, CSS rules for
Backgrounds, Colors and properties. Manipulating texts.
Fonts. borders and boxes. Margins, Padding Lists, CSS
Positioning. Animations, Tool-Tips. Style images
Variables. Media Queries, Wildcard Selectors (*. ^
and $) in CSS. Working with Gradients.
Pseudo Class.
Pseudo elements. basic of frameworks like
Bootstrap (Chapter- 5)
3. Client Side Scripting using JavaScript
Syntax of JavaScript. Execution of
JavaScript, Internal. Embedded and External Javascript.
variables, arays, functions, conditions, loops. Javaacript:
Pop up boxes, JavaScript objects and DOM. JavaScript inbuilt
functions. JavaScript validations and
Regular expressions. Event handling with JavaScript. Callbacks in
Javascript. Function as arguments in JavaScript. Introduction to ISON
(Chapter 4)
4. Server Side Programming with PHP
Difference berween Client side and
Server side scripting. Structure of PHP
decision and page. PHP Syntax variables. :

looping with examples. PHP and HTML. Arrays and Functions.


uploads. Dates and time zone. String. Form processing. File
Eion and State,
Working with Regular Expressions. Exception Handling. Basic concepts of
State management
using query string, hidden form controls. Cookies. Session variables
(Chapter 5)
5.
Database
Programming wlth PHP and MySQL
DC MySQL commands. PHP functions for database
PP, connectivity. Implementation of CRUD operations using
Prepared Statement and stored procedure execution
6. in PHP
Advanced Web (Chapter 6)
cnronous Web
Programming Concepts
AX, and Programming, Difference berween synchronous and
JQuery. Web service and API asynchronous web
development
nent using PHP
(Chapter D7) prograng
TABLE OF CONTENTS
Chapter- 1 Introduction to WEB (1-1)to (1 22)
1.1 Basics of Www.. 1-2
1.1.1 History of wwW
1-2
1.2 HTTP Protocol
*** . 1 -2
1.2.1 HTTP Request Message Structure.. .1-3
1.2.2 HTTP Response Message
Structure. 1-5
1.2.3 Features of HTTP Protocol...
1 7
1.2.4 Limitations of HTTP Protocol...
..1-8

1.3 Client Server Architecture..


18
1.3.1 2-tier Architecture.
.. 1 -8
1.3.2 3-tier Architecture.. ******.
1-9
1.3.3 Multi-tier Architecture.
. . 1 10
1.4 Web Browser . ..... 1 - 11

1.4.1 Functions Defined by Web Browser.. ...1 12


1.4.2 Web Browser Architecture.. 1 - 13

1.5 Web Server.. ... 1 - 14

1.5.1 Web Server


Operations.. ..1-14
1.5.2 General Server Characteristics ****.* l -16

1.5.3 Apache. .... 1 - 16


1.5.4 IIS.. . . 1 16
1.5.5 Functions of Web
Server. 1 17

1.6 Introduction to Web Server Installation and Configuration.. .1-18

1.7 Short Questions and ... 1 -20


Answers..
Chapter 2 Web Deslgn (2-1) to (2-22)
2.1 Concepts of Effective Web Design... .. 2-2
2.2 Web Design Issues.. ... 2 -3

(v)
..2 4
Issues..
2.2.1 Browser Compatibility
**************4
..2-4
2.2.2 Bandwidth..
** ** 2 5
2.2.3 Cache.
.... 2 - 6
2.3 Display Resolution..
** . 2 - 6

2.4 Look and Feel ofthe Website


... 2 -7
2.5 Page Layout and Linking...
2.6 User Centric Design... ....2-10

.. 2 -12
2.7 Sitemap.
Publishing Website.. ..2-15
2.8 Planning and
2.8.1 Planning Web Site... .2-15

.2-15
2.8.2 Objectives..
2.8.3 Target Audience.. .2-15

2.8.4 Web Site Development Process . . . ...2-16

2.8.5 Process of Publishing Web Site.. ********* .2-18

2.9 Designing Effective Navigation. ... 2- 19


...2 - 19
2.9.1 Features of Browser Navigation.. ****.

2.9.2 Types of Navigation System.. .....2 -200

2.10 Short Questions and Answers... . 2 21

Chapter 3 Basics of HTML and CSS (3 1) to (3 200)

Part:HTML
3.1 HTML Page Structure. 3-3

3.1.1 Document Structure... 3-4

3.1.2 Difference between


Tag and Attribute.. 3 - 5

3.1.3 Commenting Code. o******


.3-5

3.2
Formatting Tags in HTML.. ..3-5
3.2.1 Displaying Header.. ...3-5

3.2.2 Setting Font


Style. ° ° °
..3-8
° *

3.2.3 Text Alignment. 3 - 8

3.2.4 Setting the **************e*****eceseso 3 -9


Font .. ******
3.3 Tables. ... 3-10
3.3.1 Basic Table Structure..
..3-11
**********

3.3.2 RowSpan and ColSpan... 3 - 14

3.3.3 Additlonal Table Elements.. .3-31


3.4 Links. 3 - 35

3.4.1 Use of Image as a Link... -37


3.4.2 Targets within the Same Document. *******.. . 3 39
3.4.3 Uses of Links. * . 3-40

3.5 Images. 3 -40

3.6 Metatags... .3 -42

3.7 Frames.. s * 3-44

3.7.1 Frames with Scrollbars . . 3-47

3.8 HTML Form TagS . . ..3-51


3.8.1 Text.. *ose. ....3-52

3.8.2 Textarea.. ...3- 53

3.8.3 Checkbox... 3-55

2.8.4 Radio Button... . 3 56

3.8.5 Button... ...3 58

3.8.6 Menu.. ....3-59


3.8.7 Specialized Controls.. ...3-69

3.8.8 Number and Range. ...3-70

3.9 Media.. ****°o***.


..3- 73

3.9.1 Audio Control.. ******


...3-73
.3-74
3.9.2 Video Control..
..3- 75
3.10 API..
...3- 75
3.10.1 Geolocation ...
...3 -76
3.10.2 Drag and Drop..
...3-79
3.10.3 Web Storage.
..3-81
3.11Introductionto HTML5.

(vi)
in Relation to Validations...
3.12 HTMLS Tags ..3-83
Footer..
3.12.1 Header and . **** 3 833
3.12.2 Heading Groups. 3 85
3.12.3 Navigation.. averagd*ss*otdse . 3 - 86

3.12.4 Articles and Sections... ***


...3 86
3.12.5 Figures and Figures Captions. ************** ****** * . 3 888

3.12.6 Aside.. 3 89
PartI:CSS
3.13 Need for CSS.
.3-90
3.13.1 Benefits of CSS.. ***********
. 3 90

3.14 Basic Syntax and Structure. .3-91


3.15 Location of Styles...
..3-93
3.15.1 Inline Style Sheet.
.3-94
.

3.15.2 Document Level Style Sheet..


..3-95
3.15.3 External Stylesheet...
...3-97
3.16 Selectors..
.3-99
3.16.1 Simple Selector Form.. **
..3-99
.

3.16.2 Class Selectors.


.3 - 100
3.16.3 Generic Selectors..
..3-102
3.16.4 Id Selectors. ****

*** 3 - 104
3.16.5 Universal Selectors ...

. 3 106
3.16.6 Attribute Selector...
...3 107
3.16.7 Contextual Selector. .. 3 108
3.17 Backgrounds...
3 109
3.18 Colors.
..3-112
3.18.1 Color Groups..
....3-112
3.18.2 Color Properties...
....3 - 113
3.19
Manipulating Texts and Fonts .... 3 - 118
3.19.1 Font Families.
***

3.19.2 Font Sizes...


****
****. . 3 118

.3-119

(vii)
3.19.3 Font Variants. ...3 120
3.19.4 Font Styles.
. 3 121
3.19.5 Font Weights.
. 3122
3.19.6 Font Shorthands.. . 3 123
3.19.7 Text Decoration.. ...3- 124
3.19.8 Alignment of Text..
.. 3 -125
3.20 The Box Modeling....
.. 3-127
3.20.1 Borders.. .. 3 -128
3.20.2 Margins and Padding.. 3-133

3.21 Lists.
....3-136
3.22 Positioning the Elements. . 3 143
3.22.1 Absolute Positioning.. ...3 - 143

3.22.2 Relative Positioning. 3 -145

3.22.3 Static Positioning.. ..3-147

3.23 CSS2... ....3 -148

3.24 CS$3... . . 3 149

3.25 Animations.. 3 - 150

3.26 Tool-Tips.. ...3- 152

3.27 Style Images... 3 - 154

3.28Variables. ...3-158

3.29 Flex Box.. . 3-159

3.30 Media Queries... 3-162

3.31 Wildcard Selectors (*, A


and $) in CSS ... 3 - 163

3.32 Working with Gradients.. . 3 165

3.33 Pseudo Class..***** .3-167

3.34 Pseudo Element.. . .3- 170

3.35 Bootstrap Framework.. . 3 -


172

.3-176
3.35.1 Grid System..

(ix)
3.35.2 Typography. .3-178
3.35.3 Tables.. . 3 184

3.35.4 Images. ...3-186


3.35.5 Button... ...3-187
3.35.6 Form. ..3-188
3.36 Short Questions and Answers..
...3-193
Chapter 4 Client Side Scripting using JavaScript (41) to (4-122
4.1 Features ofJavaScript.. 4-2
4.2 JavaScript Syntax and Types.. 4-2
4.3 Keywords, Identifiers and Comments.. . . 4-5
4.4 Data Types.
4- 6
4.5 Variables . .
4- 6
4.6 Operators...
... 4-8
4.6.1 String Concatenation Operator.
.4-8
4.7 Input and Output . . .

...4-9
4.7.1 The document.write...
4-9
4.7.2 Popup Box...
4-10
4.8 Conditions and Loops..
. 4 13
4.9 Arrays
...4 24
4.9.1 Array Declaration..
..4-24
4.9.2 Array Initialization..
4-24
4.9.3 Two Dimensional Array..
4-288
4.10 Functions.
..4 31
4.10.1 Returning Value from the Function..
.....4-33
4.10.2 Passing the Parameters
to the Function... ....4-34
4.10.3 Passing an Array to the Function... .4-35
4.11 JavaScript Objects and DOM... ... 4 - 48
4.11.1 Definition
of DOM. ..4-48

(x)
4.11.2 DOM Tree... .4 -48
4.11.3 Using DOM Methods. .4-50
4.11.3.1 Accessing Elements using DOM. . . 4 - 50

4.11.3.2 Modifying Elements using DOM.. ..4-52

4.12 JavaScript In- built Functions.. ****** 4-57

4.13 Javascript Validations... 4- 59

4.14 Regular Expressions.. .. 4 74


4.14.1 Finding Non Matching Characters ...4 76

4.14.2 Entering the Range of Characters.. . 4 78

4.14.3 Matching Digits and Non Digits... ..4-78


4.14.4 Matching Punctuations and Symbols.. ....4-78

4.14.5 Matching Words. .4 79

4.14.6 Replacing a Text using Regular Expressions . . 4 79

4.14.7 Returning a Matched Character... ....4-80

4.14.8 Regular Expression Object Properties.. ..4-81

4.15 Event Handling with Javascript. . .. 4-87


4.15.1 Handling Events from the Body Elements... ...4-91

4.16 Callbacks in Javascript... .4- 98

4.17 Function as Arguments in JavaScript... 4-99

4.18 Object Concepts in JavaScript... 4 1000

. . 4 100
4.18.1 Math Objects..
. 4 102
4.18.2 Number Objects. *********.

...4 - 103
4.18.3 Date Objects...
...4-107
4.18.4 Boolean Objects...
..4- 107
4.18.5 String Objects * * * * o * * * * * * ° * *

4 110
Modification..
4.18.6 Object Creation and
.. 4 112
4.19 Introduction to JSON..
...4 112
4.19.1 Syntax ********
.4-115
4.19.2 Function Files...
4117

4.19.3 HTTP Request..


(xi)
4.20 Short
Questions and
Answers... 4-119
Programming
with PHP (5 1) to (5- 68
Server Side
Chapter 5
Scripting...
between Client Side and Server Side -3
5.1 Difference
Introduction to PHP. -3
5.1.1
Server.. -4
5.1.2 PHP and WAMP

5.2 Structure of PHP Page..


**
.. 5 4 -

5.2.1 PHP and HTML.. . .5-5

5.3 Reserved Words and Comments. . 56

5.4 Variables ... .5-7

5.5 Data ***** 5-8


Types .. **********e*°°**

5.5.1 Integer Type. **********e*.5 -8

5.5.2 Double Type.... 58

5.5.3 String Type.. .5-8


5.5.4 Boolean Type.. ..5-8

5.6 Operators. .5-9


5.6.1 Arithmetic Operators. . . . 5 -9
5.6.2 Relational Operators..
...5-9
5.6.3 Boolean Operators..
*** . 5 -
9
5.7 Output.. ** S - 10

5.8 Decision and Looping with Examples PHP and HTML... 5-11
5.8.1 Selection Statements..
.5-11
5.8.2 Loop Statements.
..5-13
5.9 Arrays..
. 5 22
5.9.1 Array Creation..
** 5 -22
5.9.2 Accessing Array Elements...
.5-22
5.9.3 Types of Arrays in PHP..
522
5.10 Functions...
...5-27
5.10.1 General
Characteristics of Functions. ...5 -27
5.10.2 Parameters..
*************** 5 - 2 9

(xii)
5.11 String . 5 - 30
5.12 Form Processing.
.5-32
5.13 File uploads..
.. 5-44
5.14 Dates and Time Zone..
.5-46
5.15 Working with Regular Expressions ...
****. 5-48
5.16 Exception Handling... ****ee
**** ******. ... 5- 52
5.16.1 Custom Error and Exception Handling... . 5 544

5.17 Need of Session Management.... *************** .5-56


5.18 Basic Concepts of Session and State.... 5- 56
5.18.1 Hidden Fields... 5 57
5.18.2 Query String.. .-59
5.18.3 Cookies... . 5 60
5.18.3.1 Working of Cookies ***°°°°.°*°°*°**°°°° 5 61
5.18.3.2 Using Cookies..
********************.*****
**** ***** ******eos**...5 61
5.18.3.3 Persistent Cookie.. *°°°*°**°°*°*°°*°* ******.
....5- 63

5.18.4 Session.. 5-64

5.19 Short Questions and Answers.. .5- 67

Chapter 6 Database Programming with PHP and MySQL


(6-1)to (6 30)
6.1 Introduction to MysQL ******eseeeeee
6 2
6.2 Basic MysQL Commands. ee************* *****e********eo** ... 6-3

6.3 PHP Functions for Database Connectivity . . ...6-6

6.4 Implementation of CRUD Operations using PHP.. ... 6 7

6.4.1 Insertion of Data and Retrieve Query Result... .6-9

6.4.2 Examples. ******. ....6- 13

6.5 Prepared Statement and Stored Procedure Execution in PHP... ... 6-23

6.5.1 Prepared Statement. 6-23

6.6 Short **ee**.|6 29


Questions and Answers..

(xii)
Advanced Web Programming Concepts (7 1) to (7-40
Chapter 7
Web Programming. 7-2
7.1 Asynchronous
between Synchronous and ASynchronous web Programming... 7.
7.2 Difference
..7-2
7.3 AJAX..
AJAX... 7-2
7.3.1 Introduction to
7-3
7.3.2 Archltecture. . ******eo*

7.3.3 XMLHttpRequest Object. 7-5

.7-9
7.3.4 Call Back Methods.
***e***e**e.
..7- 10
7.3.5 Coding AJAX Script.. **********

7-17
7.4 JQuery.
.7-17
7.4.1 Workingwith jQuery...
...7-17
7.4.1.1 Basic Syntax...
.7-18
7.4.1.2 Loading JQuery.
7 - 19
7.4.1.3 Selecting Elements . .
...7 26
7.4.1.4 Changing Styles...
.7-27
7.4.1.5 Creating Elements.

7.4.1.6 Appending Elements . . ...7-28

..7- 29
7.4.1.7 Removing Elements..
. 7 31
7.4.2 Using Plugins in jQuery.

7.5 Web Service . 7 33


... 7 -34
7.6 API Development using PHP..
..7-34
7.6.1 What is REST API ?....
.7-35
7.6.2 What is PDO ?..
7.6.3 .7-35
Creating REST API using PHP . **e...

Solved Model Question Paper (M-1) to (M -4)

(xiv)
4-120 Client Side Scrip ting using JavaScript
Web Programming
used In JavaScript
Q.3 Enlist the objects Boolean object
Math Object i) Number Object
ii) Delete object iv)
Ans.: i)
statement ? Glve an example.
Q.4 What Is JavaScript
is very much similar to C.
much similar For example
The assignment statement in JavaScript
Ans.:
Sum+-10
Sumasum
Can be wrtten in Jav
Q.5 Glve any two uses of JavaScript.

Ans.
be used to create some web applications such as Calculats.
1) The JavaScript can

Calender, Paint like applications.


ator,
browser.
2) JavaScript can be used to detect the visitor's
Q.6 What kind of comments are supported by the JavaScript ?

Ans.: JavaScriptsupports following comments -

The // is used to specify the single line comment.


The and / canbe used to specify the multi-line comments.
The XHTML<-> and«>is used in JavaScript.
Q.7 Explain how the string literals are used in JavaScript?
Ans.: The string is a collection of characters. The string literal is used within the single
quote or double quotes.
Q.8 What is the use of the word 'var in the JavaScript ?
Ans.: The word is used to define the variables
var
of numericor string type.
Q.9 What do you mean by Coercion ?
Ans.: JavaScript supports the automatic type conversion. The coercion is a type conver
method. This is implicit type of conversion.
Q.10 What is the use of parselnt) and parseFloat() methods ?

Ans.: The parselnt() and parseFloat() methods are used to separate out the integ and
float values respectively from the
string. For example parselnt("12abc") will return i
the string
Q.11 What is the use of pop up boxes in
JavaScript ?
Ans.: There are three
types of popup boxes used in JavaScript. Using these opup boxes
the user can interact with the web pop
application.
Q.12 What is the use of
toString method with respect to arrays 7
Ans.: The toString method
converts the
array to string
TECHNICAL PUBLICATIONS- An
up thrust for knowledge
Wed Programming
4-121
are the advantage of Client Side Scripting using
Q.13
What
document ?
indirectly embedding the JavaScript
JavaScript in the Web
Eallowing are the
advantages of
Ans. indirectly embedding the
document JavaScript in the web
Script can be hidden from the browse

lavout and presentation of web document can


be separated
interaction through the JavaScript. out from the user

Q.14 what are the


properties and methods object window for
screen output ?
Ant: Following are some
properties methods of object window
and
The property write of object window is used to
,
The methods alert, prompt and confirm
display something on the screen.
are useful for handling screen output and
keyboard input.
Q.15 Explain aray creation in JavaScript with example.
In JavaScript the array
Ans.: can be created using Array object. Suppose, we want to create
an array of 10 elements then we can write,
vararnew Aray(10)%
Using new
operator allocate the memory
we can
dynamically for the arrays. In the
brackets the size of an array is mentioned and the var ar denotes the name of the array.
Thus by the above sentence an array ar will be created in which we can store
10 elements at the most. Sometimes the above statement can be
written like this
var ar,

w Aray(10)
Q16 What is the use of 'all' in DOM tree traversal?
Ahs.: The al is a object model collection which is used to refer all the HTML elements. For

epresenting all the elements present on the HTML document the 'all' is used.
Q.17 What is onload event ?
Ans.: The onload event is an event that gets activated as soonas the web page gets loaded
on the browser's
window.
Q.18 Enlist any four events.
mouse
Ans
n e MouseEvent are mousedown, mouseup, mouseover, mousemove, mouseout.
Q19 What is DOM ?
DOcument Object Model DOM) is a set of platform independent and language
and
neutral ap which describes how to access

PPucation programming interface (AP)


tmanipu E the information stored in XML,XHTML and JavaScript
documents.
Client Side Scripting using.
Web Programming 4-122
Q.20 How do you put a message in the browser's status bar ? aScript
a) window.status("put your message here")
b) window.status "put your message here"
c) statusbar = "put your message here" GTU: Summer-17, Mark 1
Ans.: b.
window.status="put your message here
Q.21 What is the correct syntax for referring to an external script called "x.js"2
a. <script type = "text/javascript" href="xxx.js">
b. <script type = "text/javascript" src="xxjs">
c. <script type = "text/javascript" name="xx.js"> GTU :Summer-17, Mark 1
Ans.: b. sseript type =
"text/javascript" sre="xxx.js">

O00

TECHNICAL PUBLICATIONS-An
up thrust for
knowledge
SOLVED MODEL QUESTION PAPEER
(As per New Syllabus)
Web Programming
II
Semester-VI(CE/CSE) Professional Elective

Time:25Hours) ITotal Marks:70

Instructions
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.

3. Figures to the right indicate full marks.


section 1.2) 3
Q.1 a) Diferentiate between GET and POST method (Refer
b) Explain 3-tier client server architecture. (Refer section 1.3)
c) Explain different website designing issues. (Refer section 2.2)
website.
a) Explain the points which should beconsidered for planning
a
Q.2
(Refer section 2.8) 31
section 3.14)
b) Explain basic syntax and structure of CSS with example. (Refer
c) Write HTML code to draw table given below:
www.wwww.wwwwww.www.wwwwwwww.www

Image (20 %) Company Nane (80 6


Schedule
wwwwwwwwwwwM wwww

Type
wwww wwwwww.w ww**

3
wwwwwwwwwwwwwwwwwwwwwww.

4
pe2
wwwwwwwwwwwwwwwwwwwwwwwww

(Refer example 3.3.5)

OR

c) Describe the structure of a HTML document. What is the difference between tag and
attribute? Explain with an example. (Refer section 3.1)
Q.3 a) Enlist the uses of hyperlinks. (Refer section 3.4)
b) Explain arrays in JawaScript with example. (Refer section 4.9)

(M-1)
M-2 Solved Model Question Paper
-
WebProgramming
(Refer section 4.7)
C) Explain popup boxes in JavaScript with examples.

OR

Q.3 a) Explain document object model with example. (Refer section 4.11) [3
section 4.16) 41
b) Explain the concept of callbacks in JavaScript. (Refer
c) Write a JavaScript that handles following mouse events. Add necessary elements.
of
the out the
heading should turn yellow and if goes mouse
i) f the mouse is over the
show time and date
heading it should turn black. iü) If find time button is clicked
information. ii) If button named "red" is clicked, background should change
to red
and If button named "green" is clicked, background should change to green.

(Refer example 4.15.4)


Q.4 a) What is JSON ? Enlist features ofISON. (Refer section 4.19) [3
b) How to write in PHP ? Explain with example. (Refer section 5.7) 41
c) With the use of PHP, switch case and if structure perform the following and print

appropriate message. i) Get today's date i) fdate is 3, it is dentist appointment.


ii) If date is 10, go to conference iv) If date is other than 3 and 10, no events are
scheduled. (Refer example 5.8.5)
OR

Q.4 (a) Give the difference between client side scripting and server side scripting
(Refer section 5.1) [31
b) Write a JavaScript to create JSON object. Also display the values assigned to that object.
(Refer section 4.19.1) 41
c) Write modules using HTML and PHP to store information of employee (employee id, job
title, years of experience) in an array. And output the data to a web page by arranging8
the employees in ascending order of experience. (Refer example 5.12.1)

Q.5 a) What is JQuery ?Explain the advantages of using JQuery. (Refer section 7.4)
b) Explain index and associative arrays in PHP. (Refer section 5.9)

c) Write AJAX script to obtain the student information stored in XML document. The
information should be displayed on clicking the button. It should be displayed in tabular
form. (Refer example 7.3.2)

TECHNICAL PUBLICATIONS- An up thrust for knowledge


Web Programming M-3 Solved Model Question Paper
OR

Q.5 a) What is MYSQL ? Explain the benefits of PHP and MySQL connectivity.
(Refer section 6.1) 131
b) What is the difference between synchronous and asynchronous web programming ?
(Refer section 7.2) 41
c) Create a HTML form "result.html" with a text box and a submit button to accept
registration number of the student. Write a "result.php" code to check the status of the
result from the table to display whether the student has "PASS" or "FAIL" status.
Assume that the MYSQL database "my_db" has the table "result_table" with tuwo
columns REG_NO and STATUS. Also write a PHP program to delete a record from
result_table. (Refer example 6.4.2)

O00

TECHNICAL PUBLICATIONS-An up thrust for knowledge

You might also like