Assignment
No.
Name Of Assignment Page No.
1. Design a HTML page for taking sales order of various
items of some company.
3
2. Develop a simple Web based application. se client!side
and server!side scripting
"
3 Write a simple s#opping cart application in $H$.
% Write a program for database connectivity using $H$ and
&'L
( Write a program in ) to implement an *)H+ server,
using &ocket programming -it# bot# T)$ and
D$ protocols.
.
"
&tudy of L/0 and understand t#e design and
various components.
11
2
&tudy any protocol analy3er soft-are to learn and
use its important features.
13
. To learn and understand Linu4 0et-ork configurations
and commands.
1"
5.
6nstallation and configuration of /pac#e &erver.
22
11.
)reate a DTD for a catalog of cars.
31
11.
To learn and understand Windo-s 2113 server and its
associated domain operations, to configure 7/& and
DH)$, to add users and computers to a domain
3%
12.
Write an 86nternet pdate8 program using 6nternet
Transfer )ontrol
35
12 /nne4 9: 7evision 7ecord (1
7evie-ed 9y: /pproved 9y:
M7 H+D
/&&6;0M*0T 0+.: l
T6TL*: &tudy of L/0 and understand t#e design and
various components.
D/T*:
7*M/7<:
1
1
AIM: &tudy of L/0 and understand t#e design and various component
OBJECTIVE:
1=Learn #o- to setup a L/0
2=Learn #o- to use L/0 cards, T$ cables and connectors.
3=Test net-ork by using $60; command
THEORY:
/ local area net-ork >L/0= is a group of computers and associated devices t#at s#are a
common communications line or -ireless link and typically s#are t#e resources of a single
processor or server -it#in a small geograp#ic area >for e4ample, -it#in an office building=.
sually, t#e server #as applications and data storage t#at are s#ared in common by multiple
computer users. / local area net-ork may serve as fe- as t-o or t#ree users >for e4ample, in
a #ome net-ork= or as many as t#ousands of users >for e4ample, in an ?DD6 net-ork=.
LAN Topologies:
L/0 topologies define t#e manner in -#ic# net-ork devices are organi3ed.
?our common L/0 topologies e4ist: bus, ring, star, and tree. T#ese topologies
are logical arc#itectures, but t#e actual devices need not be p#ysically
organi3ed in t#ese configurations. Logical bus and ring topologies, for
e4ample, are commonly organi3ed p#ysically as a star. / bus topology is a
linear L/0 arc#itecture in -#ic# transmissions from net-ork stations
propagate t#e lengt# of t#e medium and are received by all ot#er stations. +f
t#e t#ree most -idely used L/0 implementations, *t#ernet@6*** .12.3
net-orksAincluding 1119aseTAimplement a bus topology, -#ic# is
illustrated in ?igure 1.1.
?igure 1.1 &ome 0et-orks 6mplement a Local 9us Topology
/ ring topology is a L/0 arc#itecture t#at consists of a series of devices
connected to one anot#er by unidirectional transmission links to form a single
closed loop. 9ot# Token 7ing@6*** .12.( and ?DD6 net-orks implement a
ring topology. ?igure 1.2 depicts a logical ring topology.
?igure 1.2 &ome 0et-orks 6mplement a Logical 7ing Topology
2
/ star topology is a L/0 arc#itecture in -#ic# t#e endpoints on a net-ork are
connected to a common central #ub, or s-itc#, by dedicated links. Logical bus
and ring topologies are often implemented p#ysically in a star topology, -#ic#
is illustrated in ?igure 1.3.
/ tree topology is a L/0 arc#itecture t#at is identical to t#e bus topology,
e4cept t#at branc#es -it# multiple nodes are possible in t#is case. ?igure 1.3
illustrates a logical tree topology.
?igure 1.3 / Logical Tree Topology )an )ontain Multiple 0odes
LAN e!i"es:
Devices commonly used in L/0s include repeaters, #ubs, L/0 e4tenders,
bridges, L/0 s-itc#es, and routers.
CONCL#$ION: T#us -e studied L/0 and #o- to set up L/0.
3
/&&6;0M*0T 0+.: 2
T6TL*: &tudy any protocol analy3er soft-are to learn and
use its important features
D/T*:
7*M/7<:
%
AIM: &tudy any protocol analy3er soft-are to learn and use its important features.
OBJECTIVE: *4amine T)$@6$ and non!T)$@6$ protocols and capture t#em using protocol
analy3er soft-are.
THEORY:
$rotocol analy3ers capture conversations bet-een t-o or more systems or devices. / protocol
analy3er not only captures t#e traffic, it also decodes >interprets= t#e traffic. Decoding allo-s
you to vie- t#e conversation in *nglis#, as opposed to binary language. / sop#isticated
protocol analy3er -ill also provide statistics and trend information on t#e captured traffic.
$rotocol analy3ers provide information about t#e traffic flo- on your L/0, from -#ic# you
can vie- device!specific information. nlike &0M$!based management consoles, protocol
analy3ers are device independent.
/ protocol analy3er is t#e only tool t#at s#o-s you e4actly -#at is #appening, -it# respect to
traffic flo- on your L/0. +nce a problem is isolated and recorded, t#ere can be no denying
-#ic# vendor, or -#ic# system is t#e cause.?or e4ample, if your T)$@6$ sessions are
8#anging8, a protocol analy3er can s#o- -#ic# system sent t#e last packet, and -#ic# system
failed to respond. 6f you are e4periencing slo- screen updates, a protocol analy3er can
display delta time stamps and s#o- -#ic# system is -aiting for packets, and -#ic# system is
slo- to respond.
6n an 0T environment, a protocol analy3er can s#o- runa-ay traffic >broadcast or multicast
storms= and its origin, system errors and retries, and -#et#er a station is sending, trying to
send, or only seeming to communicate. Bou -ill get information t#at is ot#er-ise
unavailable, -#ic# results in more efficient troubles#ooting and better L/0 #ealt#.
/s -it# all ot#er communications protocol, T)$@6$ is composed of layers:
• IP ! is responsible for moving packet of data from node to node. 6$ for-ards eac#
packet based on a four byte destination address >t#e 6$ number=. T#e 6nternet
aut#orities assign ranges of numbers to different organi3ations. T#e organi3ations
assign groups of t#eir numbers to departments. 6$ operates on gate-ay mac#ines t#at
move data from department to organi3ation to region and t#en around t#e -orld.
• TCP ! is responsible for verifying t#e correct delivery of data from client to server.
Data can be lost in t#e intermediate net-ork. T)$ adds support to detect errors or lost
data and to trigger retransmission until t#e data is correctly and completely received.
• $o"%ets & is a name given to t#e package of subroutines t#at provide access to T)$@6$
on most systems.
CONCL#$ION: T#us -e studied protocol analy3er soft-are and its features.
(
/&&6;0M*0T 0+.: 3
T6TL*: Write a program in ) to implement an *)H+
server, using &ocket programming -it# bot# T)$
and D$ protocols.
D/T*:
7*M/7<:
"
AIM: Write a program in ) to implement an *)H+ server, using &ocket programming -it#
bot# T)$ and D$ protocols.
OBJECTIVE: Learn &ocket programming.
THEORY:
$imple TCP'IP e"(o se)!e)
*+n"tion
T#is program demonstrates a simple T)$@6$ server. 6t -ill accept a connection from a client
application, receive one line of te4t, ec#o t#at line back to t#e client and close t#e connection.
P)og)amming Iss+es
T#is program illustrates t#e classic process for a T)$@6$ server program. &ummarised, it is as
follo-s:
• )reate a socket -it# a call to socket>=
• )reate and initiali3e a so"%et a,,)ess st)+"+)e -it# t#e 6$ address set to
60/DD7C/0B >t#e server -ill listen on any 6$ address= and t#e port to -#ic#ever one
you -is# to use.
• )all bind>= to bind t#e socket address to t#e socket.
• )all listen>= to indicate t#at t#is is a passi!e so"%et, t#at -e -ant to accept incoming
reDuests rat#er t#an make outgoing ones.
• *nter a loop in -#ic# -e:
1. )all accept>= to -ait for an incoming connection
2. &ervice t#e reDuest on our ne- connection
3. close>= our connection, and continue t#e loop to -ait for a ne- one
0ote t#at itEs present form, t#e server enters an infinite loop and #as no mec#anism for
closing itself. We #ave to use a command suc# as kill to terminate it.
CONCL#$ION: T#us -e studied socket programming in ).
2
/&&6;0M*0T 0+.: 1
T6TL*: Design a HTML page for taking sales order of
various items of some company.
D/T*:
7*M/7<:
.
AIM: Design a HTML page for taking sales order of various items of some company. T#e
page s#ould display company name -it# its logo. T#e buyer -ill provide #is@#er name,
address and desired Duantity against eac# item s#o-n along -it# unit price in a table and
select desired payment mode by selecting appropriate option button, t#e form -ill also #ave
t-o command buttons! +< and )/0)*L for t#e user to select.
OBJECTIVE:
1= Learn basics of HTML
2= Learn basics of /&$.
THEORY:
-(at is an HTML *ile.
• HTML stands for Hyper Te4t Markup Language
• /n HTML file is a te4t file containing small ma)%+p tags
• T#e markup tags tell t#e Web bro-ser (o/ to ,ispla0 t#e page
• /n HTML file must #ave an (tm or (tml file e4tension
• /n HTML file can be created using a simple te1t e,ito)
o Yo+ -ant to T)0 It.
6f you are running Windo-s, start 0otepad.
6f you are on a Mac start &impleTe4t.
6n +&F start Te4t*dit and c#ange t#e follo-ing preferences: &elect >in t#e preferences
-indo-= 8$lain te4t8 instead of 87ic# te4t8 and t#en select 86gnore ric# te4t commands in
HTML files8. T#is is very important because if you donEt do t#is HTML codes probably -onEt
-ork.
Type in t#e follo-ing te4t:
G#tmlH
G#eadH
GtitleHTitle of pageG@titleH
G@#eadH
GbodyH
T#is is my first #omepage. GbHT#is te4t is boldG@bH
G@bodyH
G@#tmlH
&ave t#e file as 8mypage.#tm8.
&tart your 6nternet bro-ser. &elect 8+pen8 >or 8+pen $age8= in t#e ?ile menu of your
bro-ser. / dialog bo4 -ill appear. &elect 89ro-se8 >or 8)#oose ?ile8= and locate t#e HTML
file you Iust created ! 8mypage.#tm8 ! select it and click 8+pen8. 0o- you s#ould see an
address in t#e dialog bo4, for e4ample 8):JMyDocumentsJmypage.#tm8. )lick +<, and t#e
bro-ser -ill display t#e page.
5
E1ample E1plaine,
T#e first tag in your HTML document is G#tmlH. T#is tag tells your bro-ser t#at t#is is t#e
start of an HTML document. T#e last tag in your document is G@#tmlH. T#is tag tells your
bro-ser t#at t#is is t#e end of t#e HTML document.
T#e te4t bet-een t#e G#eadH tag and t#e G@#eadH tag is #eader information. Header
information is not displayed in t#e bro-ser -indo-.
T#e te4t bet-een t#e GtitleH tags is t#e title of your document. T#e title is displayed in your
bro-serEs caption.
T#e te4t bet-een t#e GbodyH tags is t#e te4t t#at -ill be displayed in your bro-ser.
T#e te4t bet-een t#e GbH and G@bH tags -ill be displayed in a bold font.
HTM o) HTML E1tension.
W#en you save an HTML file, you can use eit#er t#e .#tm or t#e .#tml e4tension. We #ave
used .#tm in our e4amples. 6t mig#t be a bad #abit in#erited from t#e past -#en some of t#e
commonly used soft-are only allo-ed t#ree letter e4tensions.
Wit# ne-er soft-are -e t#ink it -ill be perfectly safe to use .#tml.
Note on HTML E,ito)s:
Bou can easily edit HTML files using a WB&6WB; >-#at you see is -#at you get= editor
like ?ront$age, )laris Home $age, or /dobe $ageMill instead of -riting your markup tags in
a plain te4t file.
9ut if you -ant to be a skillful Web developer, -e strongly recommend t#at you use a plain
te4t editor to learn your primer HTML.
CONCL#$ION: T#us -e studied HTML tags and #o- to generate static -eb pages by
using HTML.
11
/&&6;0M*0T 0+.: "
T6TL*: To learn and understand Linu4 0et-ork
configurations and commands.
D/T*:
7*M/7<:
11
AIM: To learn and understand Linu4 0et-ork configurations and commands.
OBJECTIVE:
1= Ho- to configure Linu4 net-ork.
2= )ommands for configuring Linu4 net-ork.
THEORY:
Int)o,+"tion to Lin+1 Net/o)%ing
+ne of t#e common Duestions 6 #ear is 8Ho- do 6 net-ork Linu4 to my Windo-s
computerK8. /fter counting slo-ly to ten and taking some deep breat#s, 6 t#en proceed to ask
my interlocuter Iust -#at t#ey -ant to do, since t#e verb 8to net-ork8 really doesnEt mean
muc# to me ot#er t#an sales!people e4c#anging business cards at breakfast meetings.
Bou see, 8net-orking8 covers a multitude of sins. T#e Microsoft Windo-s net-orking
documentation tends to lump everyt#ing toget#er and confuse t#e traditional T)$@6$ EsocketE
applications -it# t#e Microsoft Windo-s 0et-orking applications, -#ic# use a 0et96+&
interface. )onseDuently, people tend to speak of 8net-orking8 mac#ines -it#out being
specific about -#et#er t#ey are referring to file!s#aring, email, -eb services or ot#er
protocols. T#is is rat#er like dialling a p#one number and e4pecting to #ave a meaningful
conversation -it# t#e fa4 mac#ine at t#e ot#er end.
6n t#e Linu4 -orld, -e prefer to be Duite specific about t#e protocols and applications -e use.
LetEs start by describing t#e different layers of t#e net-ork protocol stack:
T)$@6$ is a four!layer stack, unlike t#e 6&+@+&6 seven layer stack.
T#e bottom layer ! t#e p#ysical layer ! consists of t#e net-ork card and associated device
driver, most often *t#ernet but also Token 7ing, $$$ >for dial!up connections= and many
ot#ers.
T#e ne4t layer ! t#e net-ork layer ! implements t#e 6nternet $rotocol, -#ic# is t#e basis of all
6nternet communications, along -it# some related protocols suc# as 6)M$.
Layer t#ree ! t#e transport layer ! consists of t#e T)$, D$ and similar protocols. 0o
configuration is normally reDuired #ere.
Layer four ! t#e application layer ! consists of all t#e various application clients and servers,
suc# as &amba >file L print server=, /pac#e >-eb server= and many ot#ers, several of -#ic#
12
can easily Iustify an entire book on t#eir basic configuration. T#e most important of t#ese
applications is t#e Domain 0ame &ervice, -#ic# many ot#er applications depend upon.
CONCL#$ION: T#us -e studied #o- to configure Linu4 0et-ork and t#e corresponding
commands of Linu4.
13
/&&6;0M*0T 0+.: 2
T6TL*: Write a program for database connectivity using
$H$ and &'L.
D/T*:
7*M/7<:
1%
AIM: Write a program for database connectivity using $H$ and &'L.
OBJECTIVE:
1= Learn advanced features $H$
2= Ho- to connect database using $H$
THEORY:
$H$ is a scripting language t#at is embedded in HTML and interpreted by t#e server.
6t can be used to manage dynamic content, -ork -it# databases, #andle session tracking, and
even build entire e!commerce sites. 6t -orks -ell -it# a number of popular databases,
including My&'L, $ostgre&'L, +racle, &ybase, 6nformi4, and Microsoft &'L &erver.
#sing PHP
+kay, so no- youEre convinced t#at you -ant to actually try $H$ out. WeEll -alk t#roug# a
fe- simple e4amples so you can get your feet -et. <eep in mind t#at t#is is by no means an
e4#austive look at $H$, Iust a Duick starter.
2Hello3 -o)l,42
To get a feel for $H$, letEs look at some very simple $H$ scripts. &ince 8Hello, WorldM8 is an
obligatory e4ample, -eEll produce a friendly little 8Hello, WorldM8 script.
/s mentioned earlier, $H$ is embedded in HTML. >Bou could #ave a file t#at contains
almost no HTML, but usually itEs a mi4ture.= T#at means t#at in amongst your normal HTML
>or FHTML if youEre cutting!edge= youEll #ave $H$ statements like t#is:
Gbody bgcolorN8-#ite8H
GstrongHHo- to say 8Hello, WorldM8G@strongH
5.p(p e"(o 2Hello3 -o)l,426.7
GbrH
&imple, #u#K
G@bodyH
&imple, rig#tK Oust an 8ec#o8 statement, and t#atEs it. +f course, t#at on its o-n isnEt terribly
useful. 9ut it does teac# us somet#ing about t#e language. >9y t#e -ay, if you e4amine t#e
HTML output, youEll notice t#at t#e $H$ code is not present in t#e file sent from t#e server to
your Web bro-ser. /ll of t#e $H$ present in t#e Web page is processed and stripped from t#e
pageP t#e only t#ing returned to t#e client from t#e Web server is pure HTML output.=
P)inting ,ate an, time in a -e8 page
0o- -eEll do somet#ing a little more useful. T#is e4ample -ill print out t#e date and time in
a Web page.
Gbody bgcolorN8-#ite8H
GstrongH/n *4ample of $H$ in /ctionG@strongH
GKp#p ec#o 8T#e )urrent Date and Time is:GbrH8P
ec#o date>8g:i / l, ? I B.8=PKH
@@ g N t#e #our, in 12!#our format
@@ i N minutes
@@ / N print /M or $M, depending...
@@ l N print t#e day of t#e -eek
@@ ? N print t#e mont#
@@ I N print t#e day of t#e mont#
1(
@@ B N print t#e year ! all four digits
T#is code produces t#e output: T#e )urrent Date and Time is: 11:11 /M ?riday, +ctober 21 2111.
0otice t#e blend of $H$ and HTML #ere. 6Ell assume t#at you can already read HTML, so 6Ell
only e4plain t#e $H$ code. T#e $H$ code begins -it# t#e tag GKp#p and ends -it# KH. T#is
tells t#e server t#at everyt#ing bet-een GKp#p and KH needs to be parsed for $H$ instructions,
and t#at if t#eyEre found, t#ey need to be e4ecuted. 0ote t#at -#en your document is
processed and served, it -ill be received by t#e client as plain HTML. &omeone bro-sing
your site -ill not see any of your $H$ instructions, unless youEve made an error and t#e
server spits t#em out as!is instead of processing t#em first.
7egular HTML tags -it#in t#e GKp#p and KH -ill be processed normally. 0ote t#at t#e simple
script above contains a GbrH line!break tag. $H$ -ouldnEt be very useful if you couldnEt
include HTML formatting as -ell.
6f youEre going to be -orking -it# ot#ers, or if youEre Iust plain forgetful like me, youEll -ant
to comment your code as -ell. T#e @@ c#aracters indicate a comment, -#ic# t#e server -ill
not process or pass on to t#e client, unlike comments in HTML. 6f you include a standard GM!!
comment !!H -it#in t#e GKp#p and KH tags, it is likely to cause an error -#en parsed by t#e
server. +bviously, you probably -ouldnEt comment your code Duite so muc# as 6 #ave above
for suc# a basic function, but it makes a good e4ample.
?inally, note t#at eac# $H$ function is enclosed in parent#eses and ends -it# a semicolon,
-#ic# -ill seem familiar to fans of ) or $erl. 6tEs not uncommon to forget a closing
parent#esis or semicolon and #ave a number of parse errors Iust because of a simple typo, so
be sure to c#eck t#em. 6tEs #elpful to edit $H$ in an editor like Qim or *macs t#at is capable
of synta4 #ig#lig#ting. T#is allo-s you to catc# your errors rig#t a-ay.
T#e date function is Iust one of t#e built!in $H$ functions. $H$ also comes -it# functions for
database connectivity, creating $D?, &#ock-ave, O$;, ;6?, $0;, and ot#er grap#ics files,
sending e!mail, reading and -riting files, parsing FML, session #andling, talking directly to
t#e bro-ser via HTT$, and many ot#er functions.
1"
$9L :
&'L is a standard computer language for accessing and manipulating databases.
-(at is $9L.
• &'L stands for $tructured 9uery Language
• &'L allo-s you to access a database
• &'L is an /0&6 standard computer language
• &'L can e4ecute Dueries against a database
• &'L can retrieve data from a database
• &'L can insert ne- records in a database
• &'L can delete records from a database
• &'L can update records in a database
• &'L is easy to learn
$9L is a $tan,a), & B#T....
&'L is an /0&6 >/merican 0ational &tandards 6nstitute= standard computer language for
accessing and manipulating database systems. &'L statements are used to retrieve and update
data in a database. &'L -orks -it# database programs like M& /ccess, D92, 6nformi4, M&
&'L &erver, +racle, &ybase, etc.
nfortunately, t#ere are many different versions of t#e &'L language, but to be in
compliance -it# t#e /0&6 standard, t#ey must support t#e same maIor key-ords in a similar
manner >suc# as &*L*)T, $D/T*, D*L*T*, 60&*7T, WH*7*, and ot#ers=.
Note: Most of t#e &'L database programs also #ave t#eir o-n proprietary e4tensions in
addition to t#e &'L standardM
$9L 9+e)ies
Wit# &'L, -e can Duery a database and #ave a result set returned.
/ Duery like t#is:
&*L*)T Last0ame ?7+M $ersons
;ives a result set like t#is:
LastName
Hansen
&vendson
12
$ettersen
Note: &ome database systems reDuire a semicolon at t#e end of t#e &'L statement. We donEt
use t#e semicolon in our tutorials.
$9L ata Manip+lation Lang+age :ML;
&'L >&tructured 'uery Language= is a synta4 for e4ecuting Dueries. 9ut t#e &'L language
also includes a synta4 to update, insert, and delete records.
T#ese Duery and update commands toget#er form t#e Data Manipulation Language >DML=
part of &'L:
$ELECT ! e4tracts data from a database table
#PATE ! updates data in a database table
ELETE ! deletes data from a database table
IN$ERT INTO ! inserts ne- data into a database table
$9L ata efinition Lang+age :L;
T#e Data Definition Language >DDL= part of &'L permits database tables to be created or
deleted. We can also define inde4es >keys=, specify links bet-een tables, and impose
constraints bet-een database tables.
T#e most important DDL statements in &'L are:
CREATE TABLE ! creates a ne- database table
ALTER TABLE ! alters >c#anges= a database table
ROP TABLE ! deletes a database table
CREATE INE< ! creates an inde4 >searc# key=
ROP INE< ! deletes an inde4
CONCL#$ION: T#us -e studied database connectivity using $H$ and &'L.
1.
/&&6;0M*0T 0+.: .
T6TL*: Write a simple s#opping cart application in $H$.
D/T*:
7*M/7<:
15
AIM: Write a simple s#opping cart application in $H$.
OBJECTIVE:
1= Learn #o- to use $H$
2= Ho- to -rite -eb applications in $H$
THEORY:
$H$ is a scripting language t#at is embedded in HTML and interpreted by t#e server. 6t can
be used to manage dynamic content, -ork -it# databases, #andle session tracking, and even
build entire e!commerce sites. 6t -orks -ell -it# a number of popular databases, including
My&'L, $ostgre&'L, +racle, &ybase, 6nformi4, and Microsoft &'L &erver.
sing $H$
+kay, so no- youEre convinced t#at you -ant to actually try $H$ out. WeEll -alk t#roug# a
fe- simple e4amples so you can get your feet -et. <eep in mind t#at t#is is by no means an
e4#austive look at $H$, Iust a Duick starter.
2Hello3 -o)l,42
To get a feel for $H$, letEs look at some very simple $H$ scripts. &ince 8Hello, WorldM8 is an
obligatory e4ample, -eEll produce a friendly little 8Hello, WorldM8 script.
/s mentioned earlier, $H$ is embedded in HTML. >Bou could #ave a file t#at contains
almost no HTML, but usually itEs a mi4ture.= T#at means t#at in amongst your normal HTML
>or FHTML if youEre cutting!edge= youEll #ave $H$ statements like t#is:
Gbody bgcolorN8-#ite8H
GstrongHHo- to say 8Hello, WorldM8G@strongH
5.p(p e"(o 2Hello3 -o)l,426.7
GbrH
&imple, #u#K
G@bodyH
&imple, rig#tK Oust an 8ec#o8 statement, and t#atEs it. +f course, t#at on its o-n isnEt terribly
useful. 9ut it does teac# us somet#ing about t#e language. >9y t#e -ay, if you e4amine t#e
HTML output, youEll notice t#at t#e $H$ code is not present in t#e file sent from t#e server to
your Web bro-ser. /ll of t#e $H$ present in t#e Web page is processed and stripped from t#e
pageP t#e only t#ing returned to t#e client from t#e Web server is pure HTML output.=
P)inting ,ate an, time in a -e8 page
0o- -eEll do somet#ing a little more useful. T#is e4ample -ill print out t#e date and time in
a Web page.
Gbody bgcolorN8-#ite8H
GstrongH/n *4ample of $H$ in /ctionG@strongH
GKp#p ec#o 8T#e )urrent Date and Time is:GbrH8P
ec#o date>8g:i / l, ? I B.8=PKH
@@ g N t#e #our, in 12!#our format
@@ i N minutes
@@ / N print /M or $M, depending...
@@ l N print t#e day of t#e -eek
@@ ? N print t#e mont#
21
@@ I N print t#e day of t#e mont#
@@ B N print t#e year ! all four digits
T#is code produces t#e output: T#e )urrent Date and Time is: 11:11 /M ?riday, +ctober 21 2111.
0otice t#e blend of $H$ and HTML #ere. 6Ell assume t#at you can already read HTML, so 6Ell
only e4plain t#e $H$ code. T#e $H$ code begins -it# t#e tag GKp#p and ends -it# KH. T#is
tells t#e server t#at everyt#ing bet-een GKp#p and KH needs to be parsed for $H$ instructions,
and t#at if t#eyEre found, t#ey need to be e4ecuted. 0ote t#at -#en your document is
processed and served, it -ill be received by t#e client as plain HTML. &omeone bro-sing
your site -ill not see any of your $H$ instructions, unless youEve made an error and t#e
server spits t#em out as!is instead of processing t#em first.
7egular HTML tags -it#in t#e GKp#p and KH -ill be processed normally. 0ote t#at t#e simple
script above contains a GbrH line!break tag. $H$ -ouldnEt be very useful if you couldnEt
include HTML formatting as -ell.
6f youEre going to be -orking -it# ot#ers, or if youEre Iust plain forgetful like me, youEll -ant
to comment your code as -ell. T#e @@ c#aracters indicate a comment, -#ic# t#e server -ill
not process or pass on to t#e client, unlike comments in HTML. 6f you include a standard GM!!
comment !!H -it#in t#e GKp#p and KH tags, it is likely to cause an error -#en parsed by t#e
server. +bviously, you probably -ouldnEt comment your code Duite so muc# as 6 #ave above
for suc# a basic function, but it makes a good e4ample.
?inally, note t#at eac# $H$ function is enclosed in parent#eses and ends -it# a semicolon,
-#ic# -ill seem familiar to fans of ) or $erl. 6tEs not uncommon to forget a closing
parent#esis or semicolon and #ave a number of parse errors Iust because of a simple typo, so
be sure to c#eck t#em. 6tEs #elpful to edit $H$ in an editor like Qim or *macs t#at is capable
of synta4 #ig#lig#ting. T#is allo-s you to catc# your errors rig#t a-ay.
T#e date function is Iust one of t#e built!in $H$ functions. $H$ also comes -it# functions for
database connectivity, creating $D?, &#ock-ave, O$;, ;6?, $0;, and ot#er grap#ics files,
sending e!mail, reading and -riting files, parsing FML, session #andling, talking directly to
t#e bro-ser via HTT$, and many ot#er functions.
CONCL#$ION: T#us -e studied t#e basics of $H$.
21
/&&6;0M*0T 0+.: 5
T6TL*: 6nstallation and configuration of /pac#e &erver.
D/T*:
7*M/7<:
22
AIM: 6nstallation and configuration of /pac#e &erver.
OBJECTIVE:
1= 7ole of -eb server in -eb programming
2= Ho- to configure and install /pac#e server
THEORY:
-(at is Apa"(e.
/pac#e is a -eb server. 6n fact /pac#e is t#e -orlds most popular and
dominating -eb server -it# over "1R of all 6nternet -eb servers running
/pac#e. / far second is Microsoft 66&, -it# a measly 15R of market s#are. T#is
is a true testament to /pac#eEs popularity. >&tatistics courtesy of
#ttp:@@---.netcraft.com=
/pac#e actually stands for 8/ patc#y server8. &ince t#e original /pac#e -as
built from 8patc#ing8 t#e original 0)&/ HTT$ daemon in early 155(.
/pac#e is not o-ned by a single commercial entity >like 66& is o-ned by
Microsoft, i$lanet is o-ned by &un@0etscape /lliance= but rat#er, is developed
by a loose knit team of voluntary programmers scattered across t#e globe,
collaborating t#roug# t#e 6nternet. Today, development of /pac#e is
coordinated by a non!profit organi3ation called t#e /pac#e ?oundation.
/pac#e #as been -ritten in ), using a dynamic, modular arc#itecture >muc# like
t#e kernel module arc#itecture= in -#ic# pieces of functionality can be
inserted into t#e -eb server by loading pieces of code kno-n as modules. T#e
pieces of code are built as s#ared libraries@obIects on ni4 systems. T#ese
pieces of code can also be statically compiled into /pac#e. T#is makes /pac#e
#ig#ly e4tensible and configurable.
B+t /(e)e "an I get Apa"(e if I ,on=t (a!e it.
/pac#e is available for do-nload on t#e 6nternet, free of c#arge and is
bundled -it# all >KK= Linu4 distributions. 6n fact, most >or maybe all= Linu4
distributions install and configure /pac#e for you by default. 6n ot#er -ords
-#en you install Linu4, you are also installing /pac#e.
&o to obtain /pac#e you #ave t-o c#oices, eit#er Iust get it off t#e Linu4
distribution or do-nload t#e latest and greatest from ---.apac#e.org
No/ t(at I (a!e it3 (o/ ,o I install it.
/pac#e distributions come in various forms. *ac# of t#ese are described belo-:
1. Source distribution: T#is consists of t#e source code and no pre!built
binaries. +nce you do-nload a source distribution, you must compile it and run
t#e scripts bundled -it# t#e distribution to install it. T#is gives t#e user
ma4imum fle4ibility to custom configure and install /pac#e. T#e user even #as
t#e liberty of e4tending or modifying t#e source code and installing ot#er
functional modules as -ell. T#e install procedure is built directly into t#e
Makefile to build t#e source and simply issuing t#e command Emake installE
-ill install /pac#e -it# itEs defaults on your system.
23
2. Binary distribution: T#is consists of pre!built binaries for t#e various
supported operating environments and platforms. T#ese distributions come -it#
installation scripts t#at allo- you to install /pac#e on your system.
3. Packaged distributions: T#ese distributions come in packaged formats like
7$M >for 7edHat and derivative systems=. T#ese distributions are installed via
t#e standard installation management program called rpm. T#is allo-s t#e
soft-are installation of /pac#e to be tracked by t#e +perating &ystem.
/t t#e end of t#is article t#ere is a more detailed e4planation of #o- to
actually compile and install an /pac#e source distribution.
O%3 no/ it=s all installe,3 8+t (o/ ,o I "onfig+)e it.
/n /pac#e use a single configuration file called #ttpd.conf to manage its
operating c#aracteristics. 6n t#is file, you can configure /pac#e server
c#aracteristics like &erver name, port on -#ic# to run t#e server, t#e
t#reading and process spa-n limits, t#e modules t#at it loads, t#e #andlers
for various types of files, virtual directories and #osts, mime!types, access
control etc. etc. p#e-M ?or default installations you need not touc# t#is
file. +nly -#en you need non!standard options for configuring /pac#e you -ill
#ave to open t#is file. T#is file is -ell commented and pretty muc#
self!e4planatory, so editing it is a bree3e.
CONCL#$ION:
T#us -e studied #o- to install and configure /pac#e server.
2%
/&&6;0M*0T 0+.: 11
T6TL*: Develope a simple application using M/$6 and
T/$6.
D/T*:
7*M/7<:
2(
AIM: Develope a simple application using M/$6 and T/$6.
OBJECTIVE:
1= Learn -#at is M/$6
2= Learn -#at is T/$6
THEORY:
Int)o,+"tion to MAPI
M/$6 defines a complete arc#itecture for messaging applications. T#e arc#itecture specifies
several -ell!defined components. T#is allo-s system administrators to mi4 and matc#
components to support a broad range of vendors, computing devices, and communication
protocols.
T#e M/$6 arc#itecture can be used for e!mail, sc#eduling, personal information managers,
bulletin boards, and online services t#at run on mainframes, personal computers, and #and!
#eld computing devices. T#e compre#ensive arc#itectural design allo-s M/$6 to serve as t#e
basis for a common information e4c#ange.
T#e M/$6 arc#itecture defines messaging applications, or clients, t#at interact -it# various
message services t#roug# t#e M/$6 programming interfaces, as s#o-n in t#e follo-ing
diagram.
To use t#e messaging services, a client must first establis# a session. / session is a specific
connection bet-een t#e client and t#e M/$6 interface based on information provided in a
profile. T#e profile contains configuration and user preference information. ?or e4ample, t#e
profile contains t#e names of various supporting files, t#e time interval to c#eck for ne-
messages, and ot#er settings, suc# as -#et#er to remember t#e userEs pass-ord or to prompt
t#e user for t#e pass-ord during eac# logon. / successful logon is reDuired to enable t#e
clientEs use of t#e M/$6 system.
/fter establis#ing a M/$6 session, t#e client can use t#e M/$6 services. M/$6 defines t#ree
primary services: address books, transports, and message stores.
/n address book service is similar to a telep#one directory. T#e address book can be t#oug#t
of as a persistent database t#at contains valid addressing information. /n entry in t#e address
2"
book is called an address entry and consists of a display name, an e!mail type, and an e!mail
address. T#e display name refers to t#e name, suc# as a personEs full name, t#at an application
displays to its users. Bou can provide a display name, and t#e address book service looks up
t#e display name and provides t#e corresponding messaging system address.
/ transport supports communication bet-een different devices and different underlying
messaging systems.
/ message store stores messages in a #ierarc#ical structure t#at consists of one or more
folders. / folder can be a personal folder t#at contains an individualEs messages, or a public
folder, similar to a bulletin board or online forum, t#at is accessible to many users. *ac#
folder can contain messages or ot#er folders.
/ message represents a communication t#at is sent from t#e sender to one or more recipients
or t#at gets posted in a public folder. / message can include one or more attac#ments, -#ic#
are attac#ed to and sent -it# t#e message. /n attachment can be t#e contents of a file, a link
to a file, an +L* obIect, or anot#er message.
&everal properties can be associated -it# a message: its subIect, its importance, its delivery
properties >suc# as t#e time it is sent and received=, and -#et#er to notify t#e sender -#en t#e
message is delivered and read. &ome message properties identify t#e message as part of a
conversation. T#e conversation properties allo- you to group related messages and identify
t#e seDuence of comments and replies in t#e t#read of t#e conversation.
T#e message can #ave one or more recipients. / recipient can be an individual or a
distribution list. / distribution list can contain individuals and ot#er distribution lists. ?or
messages t#at are posted to public folders, t#e recipient can also be t#e public folder itself.
9efore sending a message, you s#ould resolve eac# recipientP t#is means you s#ould c#eck
eac# recipient against t#e address book to make sure its e!mail address is valid.
Int)o,+"tion to TAPI
T#e Telep#ony /pplication $rogramming 6nterface >T/$6= is one of t#e most significant /$6
sets to be released by Microsoft. T#e telep#ony /$6 is a single set of function calls t#at
allo-s programmers to manage and manipulate any type of communications link bet-een t#e
$) and t#e telep#one line>s=. W#ile telep#ony models for t#e $) #ave been around for
several years, t#e telep#ony /$6 establis#es a uniform set of calls t#at can be applied to any
type of #ard-are t#at supplies a T/$6!compliant service provider interface >&$6=.
T#is &ection provides a general overvie- of t#e Telep#ony /$6 and #o- it fits into t#e
W+&/ >Windo-s +pen &ervices /rc#itecture= model. T#e t-o main devices defined -it#in
t#e T/$6 model -ill be described:
• Line devicesP
• $#one devices.
BouEll also learn about t#e typical p#ysical configurations used in a T/$6 model, -#ic# can
be:
• $#one!basedP
• $)!basedP
• &#ared or unified lineP
22
• Multiline.
BouEll also learn about t#e different types of telep#one service lines used to provide media
transport services for T/$6 applications, including:
• $+T&P
• Digital T1P
• 6&D0 serviceP
• $9F service.
CONCL#$ION: T#us -e studied M/$6 and T/$6.
/&&6;0M*0T 0+.: 11
T6TL*: )reate a DTD for a catalog of cars.
D/T*:
7*M/7<:
2.
25
AIM: )reate a DTD for a catalog of cars, -#ere eac# car #as c#ild elements and t-o or t#ree
c#ild.
elements #ave t#eir o-n c#ild elements. *ac# of t#ese elements are reDuired and #as
possible
values Bes or 0o. )reate an FML document -it# instances of t#e car element defined
in t#e DTD.
OBJECTIVE:
1= Learn -#at is DTD
2= Learn basics of FML
3= Learn basics of F<
THEORY:
Int)o,+"tion to T
/ Document Type Definition defines t#e legal building blocks of an FML document. 6t
defines t#e document structure -it# a list of legal elements.
/ DTD can be declared inline in your FML document, or as an e4ternal reference.
Inte)nal OCTYPE ,e"la)ation
6f t#e DTD is included in your FML source file, it s#ould be -rapped in a D+)TB$*
definition -it# t#e follo-ing synta4:
GMD+)TB$* root!element Selement!declarationsTH
GK4ml versionN81.18KH
GMD+)TB$* note S
GM*L*M*0T note >to,from,#eading,body=H
GM*L*M*0T to >U$)D/T/=H
GM*L*M*0T from >U$)D/T/=H
GM*L*M*0T #eading >U$)D/T/=H
GM*L*M*0T body >U$)D/T/=H
TH
GnoteH
GtoHToveG@toH
GfromHOaniG@fromH
G#eadingH7eminderG@#eadingH
GbodyHDonEt forget me t#is -eekendG@bodyH
G@noteH
T#e DTD above is interpreted like t#is:
4OCTYPE note >in line 2= defines t#at t#is is a document of t#e type note.
4ELEMENT note >in line 3= defines t#e note element as #aving four elements:
8to,from,#eading,body8.
4ELEMENT to >in line %= defines t#e to element to be of t#e type 8U$)D/T/8.
4ELEMENT f)om >in line (= defines t#e f)om element to be of t#e type 8U$)D/T/8
and so on.....
E1te)nal OCTYPE ,e"la)ation
31
6f t#e DTD is e4ternal to your FML source file, it s#ould be -rapped in a D+)TB$*
definition -it# t#e follo-ing synta4:
GMD+)TB$* root!element &B&T*M 8filename8H
GK4ml versionN81.18KH
GMD+)TB$* note &B&T*M 8note.dtd8H
GnoteH
GtoHToveG@toH
GfromHOaniG@fromH
G#eadingH7eminderG@#eadingH
GbodyHDonEt forget me t#is -eekendMG@bodyH
G@noteH
/nd t#is is a copy of t#e file 8note.dtd8 containing t#e DTD:
GM*L*M*0T note >to,from,#eading,body=H
GM*L*M*0T to >U$)D/T/=H
GM*L*M*0T from >U$)D/T/=H
GM*L*M*0T #eading >U$)D/T/=H
GM*L*M*0T body >U$)D/T/=H
-(0 +se a T.
Wit# DTD, eac# of your FML files can carry a description of its o-n format -it# it.
Wit# a DTD, independent groups of people can agree to use a common DTD for
interc#anging data.
Bour application can use a standard DTD to verify t#at t#e data you receive from t#e outside
-orld is valid.
Bou can also use a DTD to verify your o-n data.
-(at is <ML.
• FML stands for *<tensible Markup Language
• FML is a ma)%+p lang+age muc# like HTML
• FML -as designed to ,es")i8e ,ata
• FML tags are not predefined. Bou must ,efine 0o+) o/n tags
• FML uses a o"+ment T0pe efinition >DTD= or an <ML $"(ema to describe t#e
data
• FML -it# a DTD or FML &c#ema is designed to be self&,es")ipti!e
• FML is a W3) 7ecommendation
31
<ML is a ->C Re"ommen,ation
T#e *4tensible Markup Language >FML= became a W3) 7ecommendation 11. ?ebruary
155..
T(e main ,iffe)en"e 8et/een <ML an, HTML
<ML /as ,esigne, to "a))0 ,ata.
FML is not a replacement for HTML.
FML and HTML -ere designed -it# different goals:
FML -as designed to describe data and to focus on -#at data is.
HTML -as designed to display data and to focus on #o- data looks.
HTML is about displaying information, -#ile FML is about describing information.
<ML ,oes not O an0t(ing
<ML /as not ,esigne, to O an0t(ing.
Maybe it is a little #ard to understand, but FML does not D+ anyt#ing. FML -as created to
structure, store and to send information.
T#e follo-ing e4ample is a note to Tove from Oani, stored as FML:
GnoteH
GtoHToveG@toH
GfromHOaniG@fromH
G#eadingH7eminderG@#eadingH
GbodyHDonEt forget me t#is -eekendMG@bodyH
G@noteH
T#e note #as a #eader and a message body. 6t also #as sender and receiver information. 9ut
still, t#is FML document does not D+ anyt#ing. 6t is Iust pure information -rapped in FML
tags. &omeone must -rite a piece of soft-are to send, receive or display it.
<ML is f)ee an, e1tensi8le
<ML tags a)e not p)e,efine,. Yo+ m+st 2in!ent2 0o+) o/n tags.
T#e tags used to mark up HTML documents and t#e structure of HTML documents are
predefined. T#e aut#or of HTML documents can only use tags t#at are defined in t#e HTML
standard >like GpH, G#1H, etc.=.
FML allo-s t#e aut#or to define #is o-n tags and #is o-n document structure.
T#e tags in t#e e4ample above >like GtoH and GfromH= are not defined in any FML standard.
T#ese tags are 8invented8 by t#e aut#or of t#e FML document.
32
-(at is <$LT.
• F< stands for F&L Transformations
• F< is t#e most important part of F&L
• F< transforms an FML document into anot#er FML document
• F< uses F$at# to navigate in FML documents
• F< is a W3) 7ecommendation
<$LT #ses <Pat(
F< uses F$at# to find information in an FML document. F$at# is used to navigate
t#roug# elements and attributes in FML documents.
Ho/ oes it -o)%.
6n t#e transformation process, F< uses F$at# to define parts of t#e source document t#at
s#ould matc# one or more predefined templates. W#en a matc# is found, F< -ill
transform t#e matc#ing part of t#e source document into t#e result document.
CONCL#$ION:
T#us -e studied FML,F&TML and DTD.
33
/&&6;0M*0T 0+.: 12
T6TL*: To learn and understand Windo-s 2113 server and
its associated domain operations, to configure 7/&
and DH)$, to add users and computers to a domain
D/T*:
7*M/7<:
3%
AIM: To learn and understand Windo-s 2113 server and its associated domain operations, to
configure 7/& and DH)$, to add users and computers to a domain
OBJECTIVE: To learn
1= Windo-s 2113 server and its domain operations
2= configure 7/& and DH)$
THEORY:
Windo-s &erver 2113 ?amily Qersion +vervie-
• Windo-s &erver 2113 Web &erver *dition is designed specifically for lo-!end and entry!level Web
#osting environments, providing a specific platform for deploying Web services and applications.
• Windo-s &erver 2113 &tandard *dition is designed -it# t#e day!to!day needs of t#e average enterprise
in mind and is t#e progressive replacement for t#e Windo-s 0T% &erver@Windo-s 2111 &erver line of
server operating systems.
• Windo-s &erver 2113 *nterprise *dition is designed specifically for t#e needs of larger customers, as
t#eir needs surpass t#e functional levels of Windo-s &erver 2113 &tandard *dition. Windo-s &erver
2113 *nterprise *dition is t#e progressive replacement for t#e Windo-s 0T% &erver *nterprise
*dition@Windo-s 2111 /dvanced &erver line of server operating systems.
• Windo-s &erver 2113 Datacenter *dition is designed specifically for #ig#!end #ard-are deployments
for use on business!critical and mission!critical applications -#ere t#e #ig#est levels of scalability and
availability are reDuired. Windo-s &erver 2113 Datacenter *dition is t#e progressive replacement for
t#e Windo-s 2111 Datacenter &erver line of operating systems.
T#e 7ule@7&?/ /ut#oring &ystem >7/&= soft-are is an application available to state
agencies for t#e purpose of drafting administrative rules. T#is 87ules $rocessor8 >instead of a
-ord processor=, allo-s users to create and save documents in t#e FML file format for t#eir
transmission and vie-ing over t#e 6nternet.
DH)$ stands for Dynamic Host Configuration Protocol. W#at it does is dynamically assign
net-ork settings from a server. 6n ot#er -ords, instead of #aving to configure t#e parameters
related to #o- your computer communicates -it# a net-ork, it #appens automatically.
CONCL#$ION: T#us -e studied Windo-s 2113 server and its associated domain operations
3(
/&&6;0M*0T 0+.: 13
T6TL*: 6mplement a 8'uote of t#e Day8 &erver using Q9
and Win&ock )ontrol.
D/T*:
7*M/7<:
3"
AIM: 6mplement a 8'uote of t#e Day8 &erver using Q9 and Win&ock )ontrol. /lso develop a
client application -#ere t#e user -ill select T)$ or D$ +ption, $rovide t#e name of t#e &erver
and t#e $ort 0umber. W#en t#e user clicks a button 8;et t#e 'uote8, t#e client -ill receive t#e
Duote from t#e server.
OBJECTIVE: To learn 6mplementation of 8'uote of t#e Day8 &erver.
THEORY:
#sing t(e -inso"% Cont)ol
Winsock is above t#e T)$@6$ protocol stack in t#e 6&+@+&6 model. T)$@6$ is an industry
standard communication protocol t#at defines met#ods for packaging data into packets for
transmission bet-een computing devices on a #eterogeneous net-ork. T)$@6$ is t#e standard
for data transmission over net-orks, including t#e 6nternet. T)$ establis#es a connection for
data transmission and 6$ defines t#e met#od for sending data packets.
T#e Microsoft Winsock control makes using t#e T)$@6$ a bree3e. Microsoft #as -rapped up
t#e Winsock and 0*T/$6 /$6 calls into a neat package t#at you can easily incorporate into
your Qisual 9asic applications.
-inso"% Ope)ating Mo,es
T#e Transport layer >also kno-n as t#e Host!to!Host Transport layer= is responsible for
providing t#e /pplication layer -it# session and datagram communication services. T#e core
protocols of t#e Transport layer are T)$ and ser Datagram $rotocol >D$=. T#e Winsock
control supports t#e follo-ing t-o operating modes:
• sckT)$$rotocol
• sckD$$rotocol
Winsock $roperties
Winsock enables you to create clients and servers using t#e same control. T#is dual
functionality enables you to specify t#roug# property setting t#e type of application you -ill
be building. T#e Winsock control uses a number of t#e same properties, -#et#er you are
creating a client or a server, t#ereby all but eliminating t#e learning curve needed to create
applications. &ome of t#e important properties of t#e control are as follo-s:
B0tesRe"ei!e, P)ope)t0
T#is property returns t#e number of bytes currently in t#e receive buffer. T#is is a read!only
property and is unavailable at design time. T#e value returned is a long integer.
Lo"alHostName P)ope)t0
T#e LocalHost0ame property returns t#e name of t#e local #ost system. T#is is a read!only
property and is unavailable at design time. T#e value returned is a string.
Lo"alIP P)ope)t0
T#e Local6$ property returns t#e local #ost system 6$ address in t#e form of a string, suc# as
11.1.1.122. T#is property is read!only and is unavailable at design time.
32
Lo"alPo)t P)ope)t0
T#is property returns or sets t#e local port number. T#is can be bot# 8read from8 and 8-ritten
to8 and is available at bot# design time and runtime. T#e value returned is a long integer.
P)oto"ol P)ope)t0
7eturns or sets t#e protocol, eit#er T)$ or D$, used by t#e Winsock control.
RemoteHost P)ope)t0
T#e 7emoteHost property returns or sets t#e remote #ost. T#is can be bot# 8read from8 and
8-ritten to8 and is available bot# in design time and runtime. T#e value returned is a string
and can be specified eit#er as an 6$ address or as a D0& name.
RemotePo)t P)ope)t0
T#is property returns or sets t#e remote port number.
$tate P)ope)t0
T#is returns t#e state of t#e control as e4pressed by an enumerated list. T#is is a read!only
property and is unavailable at design time.
Winsock Met#ods
&ome of t#e important met#ods of Winsock control are as follo-s:
A""ept Met(o,
6t accepts t#e reDuest for connection from t#e client system. ?or t#is met#od to be used, t#e
control must be in t#e listening state.
Close Met(o,
T#e )lose met#od terminates a T)$ connection from eit#er t#e client or server applications.
?etata Met(o,
;etData is t#e met#od t#at retrieves t#e current block of data from t#e buffer and t#en stores
it in a variable of t#e variant type.
Pee%ata Met(o,
T#e $eekData met#od operates in a fas#ion similar to t#e ;etData met#od. Ho-ever, it does
not remove data from t#e input Dueue.
Listen Met(o,
T#is is invoked on t#e server application to #ave t#e server application -ait for a T)$ reDuest
for connection from a client system.
$en,ata Met(o,
T#is met#od dispatc#es data to t#e remote computer. 6t is used for bot# t#e client and server
systems.
Conne"t Met(o,
3.
T#e )onnect met#od reDuests a connection to a remote computer.
CONCL#$ION: T#us -e studied #o- to use -insock control in Q9.
35
/&&6;0M*0T 0+.: 1%
T6TL*: Write an 86nternet pdate8 program using 6nternet
Transfer )ontrol.
D/T*:
7*M/7<:
%1
AIM: Write an 86nternet pdate8 program using 6nternet Transfer )ontrol provided in Qisual
9asic t#at -ill update t#e files on a local mac#ine for -#ic# ne-er versions of t#ese files are
available on t#e server. $rovide facility for t#e user to determine -#ic# files to be updated and
-#ic# are not.
OBJECTIVE: To learn 6nternet transfer control.
THEORY:
-(at is t(e Inte)net t)ansfe) "ont)ol.
W#en Microsoft released Qisual 9asic ( t#ey included an /ctiveF control
t#at made communication -it# 6nternet servers in applications a fairly easy task. T#e
6nternet transfer control. 6t is actually an +L* interface to an underlying dynamic link
library >dll= named -ininet.dll. T#is dll is a part of t#e Win32 /pplication $rogramming
6nterface >/$6=. T#is makes t#e 6nternet transfer control an interface to a core part of
Windo-s. 9efore t#e release of Qisual 9asic ( and t#e introduction of t#is /ctiveF
control, Microsoft platform developers #ad to dig in deep in t#e comple4 -orld of T)$@6$,
Windo-s sockets and ) source code. ?ortunately Microsoft gave us t#e 6nternet transfer
control -#ic# made communication -it# 6nternet in our applications really easy. 6t
supports bot# t#e #ttp and t#e ftp protocol, but in t#is article -e -ill only talk about #ttp
communication.
-(0 Inte)net t)ansfe) "ont)ol.
W#y did 6 c#oose t#e 6nternet Transfer )ontrol to do t#isK ?irst of all, it is
really easy to use. 6n t#e most simple e4ample t#ere are only t-o lines of code -#ic#
actually let you do-nload t#e source code of almost any -eb page. Bou can also, -it#
t#e use of some nice compiled Qisual 9asic code, retrieve binary data suc# as images or
ot#er documents t#at you mig#t find in a -eb page.
T#ere are some commercial components t#at do t#is as -ell, but as you kno-,
t#ey are not free and sometimes t#ere is not even any possibility to register any t#ird
part components on t#e server, t#en in t#at case, t#is is t#e solution.
Possi8le +ses :
T#is sounds e4cellent, but -#at can 6 use t#is forK
/s mentioned, you can retrieve t#e source code of almost any -eb page. T#is gives you
many possibilities rig#t t#ere. Do-nload t#e code and t#en do some string #andling and
you #ave -#atever you -ant.
/not#er really interesting t#ing -it# t#e 6nternet Transfer )ontrol is t#at you can
retrieve binary data, if you use it in a Qisual 9asic component. 6magine t#at you
searc# your do-nloaded source code for image tags and store t#ose image links in
an array. T#en run a function t#at do-nloads all images as -ell. Bou #ave built an
application t#at is capable of do-nloading an entire page -it# images and ot#er
documents -it# it.
T#e ultimate application using t#is tec#nology -ould be one t#at automatically contacts
a remote system to c#eck for updates and t#en do-nloads all t#e ne- content or -#at
ever updates t#ere mig#t be. 6n suc# a solution it -ould be e4cellent to use t#e ?T$
capabilities of t#e 6nternet transfer control. ?ollo- t#e reference links for more
information on programming -it# t#e ?T$ protocol.
%1
CONCL#$ION: T#us -e studied 6nternet transfer control.
%2
/&&6;0M*0T 0+.: 1(
T6TL*: Develop a simple Web based application. se
client!side and server!side scripting
D/T*:
7*M/7<:
%3
AIM: Develop a simple Web based application. se client!side and server!side scripting
OBJECTIVE: To learn
1= )lient side scripting
2= &erver side scripting
THEORY:
&erver!side scripts are best suited for delivering custom or dynamic content. 9ut -#at if you
-ant a Windo-s!like menu bar on your Web site, or an e4pandable treeK Bou could
implement t#ese interface elements in a server!side script, but t#ere are serious disadvantages
to doing it t#is -ay: Bour interface -ill be sluggis# and you -ill greatly increase t#e
band-idt# used.
/ better solution is client!side scripting, -#ic# is designed to manipulate and display t#e
content returned from t#e server. T#is met#od enables you to respond to user events by #iding
or s#o-ing elements on t#e page, moving elements, or c#anging colors and fonts. &#o-ing
and #iding tables is t#e essence of #o- you create a pull!do-n menu on a Web page.
Displaying a -indo- in response to t#e mouse position allo-s a Web page to support
ToolTips.
T#e most -idely used client!side scripting language is Oava&cript, -#ic# -as invented by
0etscape )ommunications and introduced -it# 0etscape 0avigator 2.1. MicrosoftEs O&cript
-as released in response to Oava&criptEs success, and is essentially a clone. Ho-ever, t#e t-o
are not completely compatible.
CONCL#$ION: T#us -e studied server side scripting and client side scripting.
%%
Title: Distribution List Section: Annex-A / ISO Clause: 4
Title: Revision Record Section: Annex-B / ISO Clause: 8!"
Cop0
No.
Cop0 Hol,e)
01 M.R.
02 H.O.D. (Computer)
03 Practical Incharge
04
0
0!
0"
%(
Q66T, $une Lab Manual
Q66T, $une Lab Manual
Re! No:@3 t&A.B&.A@@C
&r. &ection +ld revision@
Date
0e-
revisi
on@
Date
7eason for
7evision
:B; All NA NA O)iginal iss+e
%"
Re! No:@3 t&A.B&.A@@C