WP Technical Book (3160713) APY Material
WP Technical Book (3160713) APY Material
WP Technical Book (3160713) APY Material
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. :
(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 -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
Part:HTML
3.1 HTML Page Structure. 3-3
3.2
Formatting Tags in HTML.. ..3-5
3.2.1 Displaying Header.. ...3-5
(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.6 Aside.. 3 89
PartI:CSS
3.13 Need for CSS.
.3-90
3.13.1 Benefits of CSS.. ***********
. 3 90
*** 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-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.28Variables. ...3-158
.3-176
3.35.1 Grid System..
(ix)
3.35.2 Typography. .3-178
3.35.3 Tables.. . 3 184
...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 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
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
6.5 Prepared Statement and Stored Procedure Execution in PHP... ... 6-23
(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-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- 29
7.4.1.7 Removing Elements..
. 7 31
7.4.2 Using Plugins in jQuery.
(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
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
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
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
Instructions
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
Type
wwww wwwwww.w ww**
3
wwwwwwwwwwwwwwwwwwwwwww.
4
pe2
wwwwwwwwwwwwwwwwwwwwwwwww
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.
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)
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