Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

DHTML AND PHP CHAP 0

CWAD USING HTML, JAVASCRIPT,


PAGE 10

TRANSMIssION CONTROL PROTOCOL


reliable stream
TCP/IP uses IP to deliver packets the upper layer applications
to
and
proVides a
arrive at the correct IP address, TCP goess tto
among computers on the network. Once the packets v
TCP'S main task is error checking to make sure that the right numbers ot packets are received and
that
are in proper order. Thus, TCP guarantees that the jntormation received by a computer on a Tr-
network. is exaetly the same information that was sent to it by another computer on the network.

TCPIP consists of protocols., applications. and services. Protocols enable a server application to
services, and the elient application to use those services. It is possible to design a new protocol and add

TCP/IP.
The Intermet is a large worldwide of computers. which uses TCP/IP
network
communieation protocol. Since TCP/IP Consists of various services, the Internet is in
as the under
a position to
those servVIces to all
o
computers connected to the lnternet.

Following is a brief description of some of the


commonly used services along with the protocols they us
World Wide Web
The World Wide Web is a
worldwide information service on the Internet. The World
Web. as it is popularly known, uses Wide Web or
special software called a Browser (client) and
Web Server to function. TCP/IP, HTTP an
TCP/IP is the communication
function. HyperText Transfer protocol
used by the Internet and is a must
for the World Wide
Protocol or HTTP is the Web
communication possible between a Web protocol used by the WWW service to
which runs on a Server and a Web Browser. A m
Web Server is a
Browser is simply an computer
and responds to requests made by other special softwa
that request from the application program, which computers
sends request to a Web
on the
network. A W
Web Server. Server and accepts a
FTP response
File Transfer Protocol or FTP is not
useful for transferring files just a protocol but also a
between different service and
two
computers running on different computers. FTP provides thean application. FTP is
FTP As An
operating systems such as
UNIX, MS-DOS and facility to transfer filesespecia
betwe
For two Application Windows.
computers to actually make
software, which use
understands this ol tne rir
service, both
be run on the local service. computers require special
upon what the user computer
wants to do,
to contact the
FTP server snappication tor
copying files. A client applicat
server application to
execute those instructiaons
can oe
Bven
application the remote
to the
on
application
CuteFTP and Reachout are instructions. client computer Dependir
iter.
application, which works witlh t=
commands and popular FTPapplications,
a wide two very
range of FTP
offering the FTP
service, upload functions. CuteFTP permitswhich provide
perform various operations on or
download files between the the user to log
the files such as
excellent user interfaces a
logout from the remote delete, rename client onto a
computer when done. computer and remote comp
FTP As A
Service change file the server com
Pis a service
for
computer (client) to copying files from one computer
and so on3 permissions,
another computer to
(server) another.
otfering thuss A
service and connection can be
files can made "

be sent or
recet
INTERNET BASICS PAGE 11
CHAP 01

Protocol
As a
FTP
tor copving iles between two computers. The client and the server applications both use
TP is a protocol of the file is identical to the original.
to ensure that the new copy
for communication

ELNET
IP application and protocol tor connecting local computer to a remote computer.
a a

elnet both TCP


is
a

as a terminal emulator, Whatever commands


are typed into the local computer
hTelnet application acts
the network tor execution by the
remote computer.
are sent across
IP address of the computer to connect to. Once the
Telnet. the Telnet application must be given the
To use a and a password must be supplied to access
username
is
the remote
established with computer.
nnection
ot the remote computer.
resourres
the
I n Conclusion
that use TCP/IP and its related
interconnected computer networks
is a worldwide collection of
services to the already existing
ones.
The Intenet
n e w protocols and
TCP IP prov1des the flexibility to add associated World
sen ices. of protocols such as Hyper
Text Transfer Protocol (HTTP)
and its
to the advent services, and so on.
This led service. the File Transfer Protocol (FTP) and its
associated FTP

Wide Web (WWW) advent of the World Wide


Web or the. Web, as it is
due to the
The Intenet gained popularity primarily
pOpularly Known.
to link to an Internet
Server anywhere
is understood it is quite simple has to
Internet s addressing system all that the Server
Internet Server, a Client
the can access
Once appropriate
Once linked to the
the Internet.
with complete freedom. changing and
OTter information and data. Never ending, always
rich resource for
internet really is a
he
ompletely dynamic.
SELE REVIEW QUESTIONS
link must be established between the desktop C pucl Sen
A network
location.
intormation at a central

wherein
This introduces Client/Server terminology the Client.
information is termed as
T h e desktop computer requesting tor
The computer serving intormation trom a central location is termed as the Server.

INFORMATION FILES CREATION


If information has to be stored on a central computer, it must be created first. While being crea
information can only be stored in the form of files on the computer. These files are created using sper
software programs or programming environments.

Files that travel across the largest network in the world, the Internet, and carry information from a Sen
to a Client that requested them are called Web Pages. The individual who
called Web Developer.
develops these web pages
WEB SERVER
Web Pages are created using HTML syntax. These pages must be organized and stored at a cent
computer.
The organization of web pages into directories and files stored on the HDD of a central computer is calla
Web Site creation
CHAP 02
INTRODUCTION TO HTML
ctore
Computers. Which sto web pages in the form PAGE 13
ot
ey act like se
act like service directories and files and
called
Servers. Ihey
providers that service the need for
provide these files to be read, are
amputer runs special software called Web information.
The
Serve
Web Site Management.
Server software that allows:
client's request for informatio
and
Respond to client's request
to aa client's Dy nrai.
request by
providing the page with the
p
required information.
Some
most popular software, which Servers run
to allow them
is Internet Intormation Server (IIS), to
respond to client request for
Apache Web
i n t o r m a t i o ,

Personal Web Server. Server, Netscape Server, and Microsoft

Web SCorver Software stores and


manages web
pages. When required, the Web Server
Web Pages. retrieves these web
pages from its HDD, and sends the accepts requests for
requested tor it. page back to the client who

WEB CLIENT/ BROWSER


To access information stored in the torm of web pages, users must connect to a Web Server. Once
connected. an interface that displays the contents of the web page is required.

Computers that offer the facility to read information stored in web pages are called Web Clients.

Web Clients run special software called a Browser that allows them to:

Connect to an appropriate Server.


Query the Server for the information to be read.
Provides an intertace to read the information returned by the Server.

Some of the most popular Browser software that clients run to allow them to query Web Servers for
information is Netscape Communicator, Internet Explorer.

Uinderstanding How ABrowser Communicates With AWeb Server


web pages to a Browser on a client. When a
AS Seen earlier, a Web Server is responsible for sending
Browser communicates with a Web Server,
t results into a four-step HTTP transaction. Connect

2. Reguest
ns Seen in diagram 2.1, a client's Browser

Fetrieves a web page from the server and


3. Repiy
displays the web page in the Browser. The
the client and
mmunication steps between 4 .Close
Browser Cli1ent
the server can be summarized as follows:

Diagram 2.1
Establish Connection Web Server

Before client and server can exchange


a
TCP/IP Is used to let computers
establish a link between
nic establish a connection.
d o n , they must first the nternet.
4Web Server and a Web Browser over

be given the IP address of


the server along
To co Server, the client machine must locate the
municate with the Web browser will attempt to
iwith used i.e. HTTP, FTP etc. The client
that must be
S u b protocol and establish a connection.

a s e d on the IP address supplied two protocols v1Z.


For example, a
Web Server may support
A Web multiple protocols.
Server supports
HTTP. FTP.
protocol name
by specilying ne
h
cases, cah ot the (lhke HTTP. FTP) can be accessed
proto port number
have "well KOw
number"
i e the HUTP
T
'ommon
prtovl workslike
protocols
by default HTTP, FTP etc
on port number 8O. Similarly the FTP protocol by d
wris n pNt number ^1
t the be estahbl
rotuls to a Web Server can
are
contigured on detault port numbers, the connection

Protovl:/APaddress
r eample. if the lP
address tor the SCT Server is 131.100.2.107 and communication must bC
S g l t P then any client attempting to conneet would have to pass the i establi-
address
http13.100.2.107 to the ISP whose
gateway is being used to access the
lnct
rooscan
.lt
be contigured to run on
port numbers other than the default port number. Valid values
a
protocol is
contigured other
to run on ar
ommunication link with the Web port
any number then the client when trying to
estab=
the IP address. Server must specify the
port number along with the protocol name =
Thus the complete syntax to access and connect to
any server
Protocol://sernername:port number. would be:

Client Issues ARequest And Server


As seen Sends AResponse
earlier. each Web Server controls a
i.e. the Web site). one page is treated as a
web site.
'Default WebFrom amongst the
collection of several
Document'. web
hen Browser
a
connects to a web Server
pag

umber. and the Web Server treats usngtoanbe appop a


request forProtocol
this connection a name, IP
Web Server then address
dispatches the 'Default Web Document' to the client who
the 'Defaulh
eb
and n.
he ient requires viewing any other web page then the client
connected
cte DOcument'. Tt
can
long with the connection information. Thus the specify the
specified as:
complete connection and web web
page
page name (if
knon
Protocol:llservername:port number/web page name. information will nov
web page. apart from text and HTML tags, can also ie
include
EG's, Audio files. Video files and so on. references external
references to

hus the request for a web page can be two-fold: objects like GF
The web page itself.
The request for the objects referenced by the web page i.e. GIF's, JPEC:
Executable programs and so on. JPEG's. Audio
hen an appropriately structured, HTTP request, is received irom a Browser
Nser. the
Files, Videu ile
exists, the server
ds
cate the web page requested. If the Web Page responds
by Web
DWser.
is
sent aus a
respor
prOVidngServer
the will tr
the Web Page is not found, an appropriate Error Message pare t
wiln the o
browse,lo t

ter sending the


web page the Web Server resets the connection
er. the the
the Web page, the Browser will identify the
external objeets cts tha
that we hruwser Teq
ter receiving deliver the external objects.
ge (if any)
and request the Server to
speeitiedied in tl
T C s l

wii
rcqucst
Such a
The Web Server resjonds to lhe reqnst being sCnl by the browser
broiwsC?.

by the
Terminates The Connection
Serv csponsibiliiy to lemiate the 'TC P/P comectiom witlh the Browser aller it revpods to the
S e r v e r ' s iespo
the
It is wliest. T l o w e v e r , both the|
lowever, the Browser and the Web Server must manage an unexpected closing of
Browser's rcquest.
a as well. In other words, il ihe user clicks on he Browser's STOP butlon, the Browser must
a s well.
c o m e c t i o n

a
close the c o n n e c t i o

or a Web Server must De


crash by cither a Browser ccogmzcd by the surviving computer,
Alsoa compuileriwill close the connection.
turn.
which. in
TEXT MARKUP LANGUAGE (HTML)
HYPER
weh is called llyper'Text Markup Ianguage (HTMIL) TMI. is the
The language
used to develop pages
interpreted by a Browser. Web
Pages are also called WTMI documents. HTMI is a set of special
ge
inlormation. HTML is specitied TAGS
codesdes that can be embedded
in texI to add lormatting and linkimg as

document (i.e. the Weh page).


in an
HTML

HTML Tags
An HTML. tag is a signal to

Tags are instructions t a t are embedded directly into the text of the document,
hrow text up on the screen. By convention all HTMI
browser that it should do something ofher than just
bracket ) .
tags begin with an open angle bracket (<) and end with a close angle

HTML tags can be ot Iwo types:

Paired Tags
tlanks the text. For example the <B tag
i s

along companion tag, with a


A tag is said to be a paired tag if it, between them to
b
eauses the text contained
its companion tag </B
paired tag. The <B> tag with contain. to the text they
rendered in bold. The effect of other paired tags is applied only
and the second tag (</B>)
is called the
In paired tags. the first tag (<B>) is often called the opening tag

elosing tag
turns the eflect oft.
activates the effect and the closing tag
ne
opening tag

Singular Tags does not have a companion ta


stanl-alone tag. A stand-alone tag
type of tag is the singular
or
Second does not require any companion
tag
C line break. This tag
tag will insert
a
TOr example <BR
/ >

to them. For instance, when a picture


Note additional
intormation o be supplied
be specified.
Some HTML tags require and width of the picture can

information like the height


IS placed on the sereen,
Attributes are

KnoWn as
Afribules ot a lag.
Is
to an HTML ag attributes can be associated
Additional intormation supplied spue. Muliple
the tag., separated
by a

WTilten immediately following


a syce.
Wilh a tag. also separated by
and t
of all HTML tags
the lunctionality
would lie in kmowing
ntormatiun.
textual
HTML (web) page large quantities of
creating a n to tormal
then be uscd
n
ate This skill can
where applicable.
res
pCquired to use on a
web sile.
and have this ready
inf i wl

uallW
U l w l lap

lntomatn n all thene neeels De puvie nyoE W Eques il The


U The
ulturnatirpts futf
pany l'ole
U a b d Wie

Habed Wine
aryng Ilandles
Habed Tap
Shurt Blade Barbel Tape (S1s1

Mcaln 11ade lsarled


1ape (MIST
m g Blaule Hubed Tape (11S1)
U Anmalle

creaton of the extual content of ihe Weh Sile


e done
The in
snplea
Naved as filename.himl ile. The i e will conliun the lollowi
following lex\ual AC
editor such
NVed as iduated above
materal ereated as
A' Notrpad
as an
Aller crcaling hIN lext ile,
vicw ilh Conlenth i i a
broWser .

bow ntemet
lCsing puposes wlile crcatny this c
The browser uscd lor puge
hw ap'orer r
has
ialwiays
vIeWed i browser
IMI.
lew i
been Netcap t31
i
hits been
a
ew
lile CIcalcd
Aller the lext
the ile
re-VIewed lo register l e
will be
thein
chianges
altribles
1
wlhese
s
latio. hh will be addedNetCape ts 12
preeta
applab."
tag he

UNcd with all the 1ITMIL tugs ad e


slandard t the natrt
DELTA
ENGINE:EHING
PVT. 1TD.
lcarniny ti
ieseribed in tne Oow
hg pages. Diagram 2.2

COMMONLY USED HTML COMMANDSs


Of An HTML program
The Structure
Fery HTML program has a rigid structure. The entire web page is enclosed within HTMI </HTML

WithinBODY>
thes¢ tags created using
two distinet sectionsdeseribed
are the <HEAD/HEAD> tags and the
BODY tags. These sections are below.

Document Head
Intormation placed in this section is essential to the inner workings of the document and has nothing to do
with the content ot the document. With the exception of information contained within the <TITLE>
TITLE tags. all information placed within the <HEAD> </HEAD> tags is not displayed in the browser.
The HTML tags used to indicate the start and end of the head section are:
HEADTITLE>...<TITLE></HEAD>
Document Body
The tags used to indicate the start and end of the main body of textual information are:
<BODY>

BODY>
color, font size, font weight and so on can be specified as
Page defaults like background color, text
takes are:
the <BODY> tag. The attributes that the <BODY> tag
aributes of
CSS
CHAP
Background Set
default backpround-color properly to the
the
Formatting taag Is written in the C SS file. ind-color ofot a.an clement
background-color
(background-
color:)
CSS Background |Sets the background-image property ol an clement or of the
Formatting Written in the C'SS lile. document. Thies ttag in
(background-
image :)
TEXT
Changes the body text color from its dclault value to the
attribute. color specified with
Table 2.1
Example:
BODY STYLE
="hackground: url(starfield.gif); color: red:">
Note
The -gif tile
"starlield.gif" should be
specitied to where the -gif filepresent
should be in the current
exists. working directory. If not, a Relative path

Specifying a Relative File Path:


Wherever file name needs to
a
be
BACKGROUND attribute). specilied (tor instance, gif
the a

current workingspecitied ilethemust be present in the


file needs to be
ile isnot in the
can be specified
relative directory. specitied tile must current workingspecified withIf thethe
to the current
the file only within the
current
directory. nis
because,isinclude the file directory.
directory. by default, path. The file
the Browser searchespath
for
For example. consider the
following directory structure.
C:1
Consider working with the file try.htm. To use all the
files as
backgrounds, the tag specifications will change different .gif
as follows:
boxes.gif
Meher
Use of the file boxes.gif
<BODY STYLE="background: url(../boxes.gi)"> try.htm
Use of the file texturel.gif texturel-gif
images
<BODY STYLE="background: url{texturel.gi)">
stars.gif
Use of the file stars.gif
BODY STYLE="background: url(images/stars.git)">

TITLES AND FOOTERS


Title
A web page could have a title that describes what the page is about withoul being too
wordy
achieved by using the TITLE tag. Text included between the <TITLE>...TITLE tag shwhis
title bar of the browser ows up an be
in the
window.
<TITLE> ... </TITLE>
UGC XI GRANT
REMEDIAL COACHING olleg
CHAP 02
INTRODUCc PAGE 21
ibrary
UGC 243
Footer
itle can be placed n the title bar of the bi
Ust toot of the web page. opyright information is CiioALpticed
ww. Web page and so on
lypc
re theADDRESS
or information Iraditionally
nioration
lraditnally placcd at ihe foot of the
web page. The HiML. lags are
JADRESS>
This tag should uld ideally be placed imnediately after the last line of the textual material of the web
tit could also be placed
coulkd also placcd anywhere im the body of the document. The text page.
owever.
ralics.
m
typed within these ta2s
always appCars

EAa A)><TITLEThis is the title</TITLE></HEAD>


BODY

ADDRESS>This is the footer </ADDRESS>


BODY
TEXT FORMATTING

Paraqraph breaks
textual material. The tag that provides this functionality is
A blank line always separates paragraphs in

this tag the browser, moves onto a new line, skipping one line between the previous
<P>, On encountering
line.
line and the new

Example: It doesn't bother too much about error


A channel is a dedicated path for data to flow along.
failed. So a channel can
to the processor that the transfer
correction on its own,merely reporting
of a network. It lets you
the above attributes along with those
be very fast. <P> Fiber channel has does not care tor the
buffer at Journey's end. It
source buffer t0 another
transfer data from a
contents or the data
format.</P>

It does.':
Output: dedicated path for data to Ílow along.
Channel is a repor*-*g
A on 1ts own, mere-Y
correction
about error can be
Dotner too much So a channel
transter tailed.
that the
to the processor

tast. those Ca
With
attributes along
anotrer
above
LDer channel has the
trom a
sourCe
DuIrer
t
data or t.e
transfer the
contents

you tor
It l e t s not
care
LWOrk. It does
end.
at journey's
Ler
data format.
a blank line),
Line Breakss continue on the same line (without
skipping

line and
not
next n e .
start of the
When te needs lo start
from a new
jumps to the
the D used. This tag simply
D tag should be

Example: A/5, Jay Apartments, <BR


<BR>
Technologies,
Con Chip Mumbai -
400057.
<BR/>
e Parle (East),
East, and that har helped omlatr apanv a
A Ahd The Far
Ai
gpenen

1gehir tr strn tiy adheir


tu , ATM and DI rnaton
Diagram 2..

Output for F'ocus 2:


distinctly,
but still IS not vjs uaj
When the web page is viewed in the browser the output slhows paragraphs
atractive. For instanee. headings ike Pofile, P'roducts, and Barhed
This is not a ViSay piCasing way
means ot two dashed lines, one above and one below the leading.
laying emphas1s orn headers.
Headers should prelerably be displayed in Bold, lialies and so on. Also, simple dashed lines arawn do n
have aesthetie appeal

EMPHASIZING MATERIAL IN A WEB PAGE


DOCument pages are usually divided into sections and subsections (i.c. pages could have heudngS and suh
headngs). which need to be emphasized. ITTML provides certain HEADING STYLES an
HORIZONTAL RULES, which helps break text into logical sections with visual
appea
Heading Styles
HTML supports six different levels
level is <H6>. All the of headings. The highest-level header format is <HI>
styles appear in BOLDFACE and the size of the and the lowest
chosen, i.e. <HI> to <H6> heading depends on the level
Example:
<H3>The early years</H3>

Output:
The early years

Note
As the number next to <H> (1, 2,. ..)
increases, the font size
actually decrea
eases.
Drawing Lines
The tag <HR> draws lines and
horizontal rules. This tag draws
wherever specified. The attributes to the
<HR> tag are:
a
uontal
horizontal line
ae
aeross the
whole page,
INTRODUCTION TO HTML PAGE 25
02
CHAP

Description
the center of the
rfrib ligns the
line
LEFT
on
the Rrowser
Wil aign
screen which
tlhe lefn
the line to
is

of
hy default, aligned
the screen
to screen

ALIGN
RIGHT will algn the line to the right of the sereen
ALIGN
will align the line
LIGN-CENTERthe to the center of the sereen
the size of nule
hanges ot the
of the i l e . Can be set to a fixed number of pixels, or to a percentage
IZE
Scts the width
WIDTH
sereen w Idth.
aN
alable
Table 2.2

Fample: site.
elome
to o u r W />
SIZE="4"
HR ALIGN- "left" WIDTH="10"

utput:

TEXT S T Y L E S

Bold used are <B>,..</B


BOLDEACE style. The tags
text in
Displays

Example:
home page!</B>
B>Welcome to our

Output: our home page!


Welcome to

talics between
<l>...</>

text in
ITALICS. The tags used are
Displays

Example: home page! <1>


W e l c o m e to o u r

Output: home page


Welcome to our

Underline <U>. . .

.
The tags used
are
UNDERLINED,
Isplays text as
Example: page! <IU
UWelcome to our home

Output:
elcome to our home page
web page.
the DEPL
FOCUS 3: sub-headings
displayed
on

Cmphasize the headings and


andso on. The following sections illustrate how this Web page can bemade visually, further attractive.

OTHER TEXT EFFECTS

Centering(Text, Images etc.)


<CENTER.. . ... . <CENTER> tags are used to center everything found betweenthem text. lists,
images, rules, tables or anyother pageelement.
Example:
<CENTER> Welcometo our home page! </CENTER>
Output:
Welcome to our home page
J A V A S L .

USING HTML,
CWAD
PAGE 28

Spacing (lndenting Text) SPACER>, ts att-

used for inserting


blank spaces in
an HTML
d o c u m e n t is
butes are.
The tag o r vertically
be left horizontally
space has
to
whether
horizontal space has
to be left.
TPE To specify="HORIZONTAL"
indicates that

vertical space has to be left.


TYPE
"\VERTICAL" indicates that
YPE =

integer.
SIZE Indncatcs the amount of space to be left. SiZe accepts any
Table 2.3

Note
The SPACER command is understood only by the browser Netscape. There are
techniques that can be used to introduce space in the document (understood by all BrV
will be covered in the later Chapters. wsers)
Example:
Welcome to my site <BR />
SPACER TYPE =

"HORIZONTAL" SIZE 90>Hope =

Output: you enjoy it


Weicome to my site
Hope you enjoy
it
Controlling Font Size and
Font tag
Color
CSS text
is
deprecated. Instead of
CSS font tag
Text formatting properties must be now font tag is
1ont-
Formatting are: specified in CSS
specified in "STYLE". Text
family font
Sets the text
to the formatting
Some
of the attribute properties
font-size Sets names, In case specified font for the of Font
availab
the size of of
the textmultiple fonts, specified
font-size value can if browser element. This can
font-size be not support hold one or
Sets the value can be absolute (using px or
color
color of the relative
first, it tries multuple
RGB value text. (using %) em)
Color
next one
can be set to
Example: an
English language
PSTYLE
home page

Output:
</P>
LE"FONT-FAMILY: Comic
Table 2.4
Sans MS;
name,
hexadecimal o

Welcome to our FONT-SIZE: 10px;


home
page! cOLOR: red;
">Welcome

You might also like