Академический Документы
Профессиональный Документы
Культура Документы
Day
|
<html>
<head>
<!-- This section is for the title
and technical info of the page. -->
<Title>This is a Title </Title>
</head>
<body>
<!-- This section is for all that
you want to show on the page. -->
This is a Body
</body>
</html>
á
a
| a
á
÷
÷÷
!
÷ ÷"#
- ÷÷
÷
$%!!&%!!
'
(
÷
)
Ä
÷÷
÷
]
÷ ÷
÷
÷÷
"# ÷
*
+
(
#
#
#
÷÷
Ä
]
]
$,]* ) &
- ÷
.
%÷
]
* ]
/ ÷
/ *
/ *
/
u am
m
<"#
"0-1
]#0*
2 3]#0
3"0-1
.415
"6%
%÷÷
3"6
÷÷
%
÷ ÷
÷÷
7
3.415
3"#
! r
rma
a
r
"
#$$a
ÄÄ
ma
a
r
r
r
Ä
Ä
ar
ma
a
% a r
a
r
ar
"]u#$$
a
% &
r ' r r a
(
")*#$$
a
r
"-)u#$$
y
y &r m a (
<HTML>
<HEAD><TITLE> EXAMPLE 2</TITLE></HEAD>
<BODY>
<B> This line is BOLD</B><BR>
<U> This line is UNDERLINED</U><BR>
<I> This line is ITALICS</I><BR>
<S> Text is STRIKED</S><BR>
This line is normal<BR>
<BIG>The font of this line is BIG</BIG><BR>
<SMALL>The font of this line is
small</SMALL><BR>
<DIV ALIGN="CENTER">
This line is aligned <B>centre</B>
</DIV>
<DIV ALIGN="LEFT">
This line is aligned <B>left</B>
</DIV>
<DIV ALIGN="RIGHT">
This line is aligned <B>right</B>
</DIV>
<FONT SIZE="+5" COLOR="RED" FACE="NEW TIMES ROMAN">
Doeacc <U>Centre</U> Chandigarh
</FONT>
<FONT SIZE="+3" COLOR="BLUE" FACE="ARIAL">
<BR> Doeacc<I>Centre</I> Chandigarh
</FONT>
</BODY>
</HTML>
u am +
m
r ar
r
y
]
a a r r
a
ar
a a
a ,m r a
r a a ar a
ma
ay a
a
a
a
r
Ä
] a a r r
a a
]
-
a r r
a
a ar a
a
a
a m r
rm a
r m a
a a
ar
D a
.D D
a
r
a
rm
a DD
a
r
a
r a a
a
a ar a
ma
ay
a r r r m r
a
r
ar
"Y u # $$
y m ra
a
a ar a]
"* # $$
a
ar
a r r r
"Y u#$$
mar
m
a ar D]) )]*)u a
*u
a
m r
r
"Y u#$$
y
r m r
a
m
a ar
D]) )]*)u
" *u a ]
"Vu#$$
m r
a
m a &a
m a a
(
a
a
rm a a ar
rr
a
rm a a ar
<HTML>
<HEAD><TITLE>list test</TITLE></HEAD>
<BODY>
Computer Languages
<UL type="circle">
<LI>BASIC <LI>C <LI>C++ <LI>Pascal <LI> Fortran
</UL>
Measurement Units
<OL>
<li>Bit <li>Kb <li>Mb <li>Gb
</OL>
</BODY>
</HTML>
u am /
m
u am 0
m
<HTML>
<HEAD><TITLE>Example 4</TITLE></HEAD>
<BODY>
<B>Input/Output devices</B>
<OL>
<LI>Keyboard
<LI>Printer
</OL>
<DL>
<DT><U>Keyboard</U>
<DD>Keyboard is an input device.
<DT><U>Printer</U>
<DD>Printer is an output device it can print 1400 lines
per minute.
</DL>
</BODY>
</HTML>
u am 0
m
D
r
y r r
u am
my0,m r
.0
.
aaa.
m.
ra .
.
0
r
.0
y #$$
.
aaa.
m.
ra .
.
0 ra
r
.0
y #$a$
.
aaa.
m.
ra .
.
0*mam r
.0
y #$]$
.
aaa.
m.
ra .
.
0 ra *mam r
.0
y #$
$
.
aaa.
m.
ra .
..y.
m
r r
u am
ra
1
2 )r a
r r a r r
r
r
m
yr r u ) ]
r
a
| D
2 )r a
a ,
r r . r r
r
r u ) &
) r
ar |
|r u
(
mmaryDay!
/ 8
"#
/ "#
/ "# 2-,0!+9%9+0
/ "0-1!0%]4:
/ .415!0%]4:
/
*
/ #
/ 4#
/ 9 4#
/ 0÷
1
/ 2 !
Day+
a )
1
á r
%
a r r
ara
a
a
r
ar
"],#$$ r a
ra
m
&u-)u,u**]3]-]uD(
",Du#$$
ay a r r a a
r
"]u#$$
%
r r
"|]D#$$
r r
Ä
r a
a ara ra
"],#$$
ra
m
&u-)u,u**]3]-Y(
ay r rma
"|]D#$$
rma
Ä
Ä r a
r
r a
rr
u am 4
m
<HTML>
<HEAD><TITLE>Example 5</TITLE></HEAD>
<BODY>
<H3 ALIGN="CENTER"> Test of different HTML tags</H3>
<HR ALIGN="CENTER">
Quadratic equation :
<B>A<SUP>2</SUP>+B<SUP>2</SUP>=A<SUP>2</SUP>
+B<SUP>2</SUP>+2AB</B>
<P>
Chemical Equation :
<B>H<SUB>2</SUB>+O=H<SUB>2</SUB>O
<P> Quadratic equation tells us the formula of algebra.
Chemical equation shows one chemical reaction <P>
<PRE>
Quadratic equation tells us the formula of algebra.
Chemical equation shows one chemical reaction
</PRE>
</BODY>
</HTML>
u am 4
m
á
m
a
r
m
a
a
r
a
am m
r
a
r y
r
m
| y
y r
y r
ar
m
a
r
a
y r
y
m
|r |
|
÷
3
÷÷
÷
÷
3
÷
u
÷÷
÷
y y r
r | a
a a
a
ar
a
ra
u!ma
ra
y r
ar
r
r
a
a
y rm | a
a
r y
m
yr m
] yr
a ra a y
r
rm
r
a
r a
a
a r $ar$
a
a ar
a
r
ar
",u#$$
a ar
"*u-#$$
*
r r
"*u#$$
rm
r
r r
ay
u am 5
m
<HTML>
<HEAD><TITLE>RCC - Example 6</TITLE></HEAD>
<BODY>
<H2 ALIGN="CENTER">Doeacc Centre
Chandigarh</H2>
<HR ALING="CENTER" width="300">
<DIV ALIGN="CENTER"> Doeacc Centre Chandigarh a
setup of National Informatics Centre, Planning
Commission, govt. of India was set up in 1978 to
promote use of computers. It is one of the pioneer
computer centre of this country. </DIV>
<P>
<A HREF="HEAD.HTML">Head Office</A><BR>
<A HREF="BRANCH.HTML">Branch Office</A><BR>
<A HREF="ACHIEVE.HTML">ACHIEVEMENTS</A>
</BODY>
</HTML>
u am 5
m
aa
y r
a
r a
a
y
am
a
a r a r
-m
r
ar
a
a
-r u am ! y
a
a
a
a r
a
a
m a a
a
r
r y
]
a
r
ay
. ar
a
a am
a r
a r
y
$r
rmr $
a am $uVu,$am
r
y
r ,u#$r
$.a ar
u am 7
m
<HTML>
<HEAD><TITLE>DOEACC CENTRE - Example
8</TITLE></HEAD>
<BODY>
This example shows you how to make link
to the other web page.<BR>
<A HREF="SEVEN.HTM#Short">Short term
courses</A><BR>
<A HREF="SEVEN.HTM#Long">Long term
courses</A><BR>
<A HREF="SEVEN.HTM#Edu">Corporate
courses</A>
</BODY>
u am 7
m
u!ma
] a
a a
ar
a
.
a a y
yr !ma
ar
m
ay
a r a r yr | a
a a
y
á
a
r' !ma
ar | ay r
$
ma8
ma
m$
a
a ar
r
r
y a m a r a
r r
a
mm
a
y
r
u am 9
m
"#"0-1]#0140-%%%0:+0 0÷B
3]#03"0-1
.415
"6-#],:<=%0:0+=*4:%4#4+<=.#90=%
.
!
3*4:3"6
"+-#],:<=%0:0+=8]1"<=C??=
%
.
!
÷
÷÷
÷
÷
5
÷-
"+0*<÷
D
÷
D
÷3-.+÷
÷÷÷ E>
.+"6-#],:<=%0:0+=*4:
%4#4+<=.#90=
3*4:3"6
3.415
3"#
u am 9
m
ra
1
)r a
a,
|
y r
a
m
rr
u
2 a
2 Ya&
..yam(
2 *
2 ]
a
m
2 aru
2 &
.. m(
2 Ya
2
aV
a
mmaryDay!+
2 a )
2 y r
2 y y r
2
ra
2
aa
2
a
ar
a
ra
2 u!ma
2 u am D
r
2 ra
1
Day/
ra
!a ra
r
ma a
a r a
r yr
y
a r r r a a a
r y a
e-mail:<A HREF="mailto:buddhiman@hotmail.com">
buddhiman@hotmail.com</A>
</PRE>
click the button for the listing of books available.
<A HREF="BOOKLIST.HTML">
<IMG SRC="BOOK.BMP" BORDER="NONE" ALT="CLICK ME" ALIGN="CENTER"></A>
<BR>
place your orders on internet and the delivery will be in 24 hours.
ma ay
y
ma ma y
r
m r
a
!r
a
a r
ma
a
y a
a
y a
a
r ay
ma
a
r a
a
!r
a
a
m
r
y
a
m
ma
!r
a
a
m
r
Y
ra
a
<]ma a
1
ma
r
ay
ma a
a r
a
ar a m
a r a
a
ma
ma
a
r
ar
,u#$$
am
ma ma
r a
a ar
a
r
ar
u#$$ a y
ma ma
a &Du- *u) Y(
)*D#$$
%
a
*u-#$$
*
r r
u am /
m
<HTML>
<HEAD><TITLE>TEST OF MAP REGION</TITLE></HEAD>
<BODY BGCOLOR="YELLOW">
<MAP NAME="RECT-CIR">
<AREA SHAPE="RECT" COORDS="0,0,110,50" HREF="RECT1.HTM">
<AREA SHAPE="RECT" COORDS="130,0,243,50" HREF="RECT2.HTM">
<AREA SHAPE="RECT" COORDS="0,70,110,120" HREF="RECT3.HTM">
<AREA SHAPE="RECT" COORDS="130,70,243,120" HREF="RECT4.HTM">
<AREA SHAPE="CIRCLE" COORDS="110,50,130,70" HREF="CIRC.HTM">
</MAP>
<DIV ALIGN="CENTER">
THIS IS A TEST OF MAPING REGION OF AN IMAGE.<DIV>
<P>
<IMG SRC="MAP-REG.BMP" USEMAP="#RECT-CIR" BORDER=0
ALT="CLICKABLE IMAGE">
<P>
<DIV ALIGN="CENTER">JUST FOR FUN.<DIV>
</BODY>
</HTML>
u am /
m
m
r
r r a
a
a
a
arra
a ra
m
m a r
r
ar
a a
r
a
ay
a a ara
a y r a
ma
a y a
ar
Ä Ä
a
u
-.#0
÷ "#]
.4+10+
3-.#0
÷
÷
%-2]4:
÷
÷÷
3%-2]4:
÷
÷
-#],:<.44
÷
÷V u-
+3+
÷
÷5 ÷
-#],:$#0*%0:0++],"& 3F-#],:$42
]11#0.44&!÷-
÷
"3"
÷÷÷.÷
÷÷
÷
÷÷÷
÷÷ 3
!÷-
÷
131
÷
÷÷.÷
÷÷
÷ ÷
÷÷÷
÷÷
÷÷ 3
!÷
-
÷
r
.rD.D
rr
a
a
m
a*.*
-
1
"÷÷
3"
÷÷ 6$&
"÷÷
3" ÷
÷÷ 6$&
3+
+
1÷÷
31
÷÷ E
1÷÷
31 ÷
÷÷ E
3+
+
÷
1÷÷
31
÷÷ ÷
1÷÷
31 ÷
÷÷ ÷
3+ ÷
3-.#0
÷
ra
1
2
a a r r
a
y r
r
2 ] r
a ]ma a a r
a
2 ] r
)may
ma
r
a
2
ma
r
%
am
a
2 a a y r
ma
mmaryDay!/
2 ra
!a ra
r
2 ]ma
2 )
a ]ma
2 ra
a
<]ma a
2 a ]
r
2 u am D
r
2 ra
1
Day0
Ä Ä
)r a
a
a
a
a
a
ay m r r
a
r
ar
*Du*#$$
a
a r r
)u )],#$$
am
a
a
)u DD],#$$
am
a
a
|]D#$$
a
a
r a
a r a
a r
a a
)*#$$ a r r a
a
a
a
r
a r a
r a
r
);*,D#$$ a r
ma
a
a
a
a
r
a r a r a
r
a
a r
D
a
a r
a
r mr
a
r
ar
],#$$
r
%
a a
m
r
a ar u- *] )u,u*
V],#$$
r
a a
m
r
a ar ]DDu a
)*#$$ a r r a
a
a
a
r a r a r a
r
);*,D#$$ a r
ma
a
a
a
a
r a r a r
a
r
a
a a
a
],#$$
r
%
a a
m
a ar u- *] )u,u*
V],#$$
r
a a
m
a ar ]DDu a
*| ,#$$
m r r
a
) ,#$$
m r m
a
|]D#$$
m
r
a
a r a a r
a a
)*#$$ a r r
);*,D#$$ a r
ma
á á
a
a a
a
r
ar
],#$$
r
%
a a
m
a ar u- *] )u,u*
V],#$$
r
a a
m
a ar ]DDu a
*| ,#$$
m r r
a
) ,#$$
m r m
a
|]D#$$
m
r
a
a r a a r
a a
)*#$$ a r r
);*,D#$$ a r
ma
u am 0
m
<HTML>
<HEAD><TITLE>DOEACC CENTRE - Example 14</TITLE></HEAD>
<BODY>
<DIV ALIGN="CENTER">
<B>Time Table</B>
<P>
<TABLE BORDER=2 CELLPADDING=5 CELLSPACING=5>
<TR><TH>City<TH>Distance<TH>Fair
<TR><TD>Bhopal<TD>500 k.m.<TD>Rs/- 200.00
<TR><TD>Delhi<TD>450 k.m.<TD>Rs/- 175.00
<TR><TD>Chandigarh<TD>750 k.m.<TD>Rs/- 300.00
<TR><TD>Kanpur<TD>75 k.m.<TD>Rs/- 25.00
</TABLE>
</DIV>
</BODY>
</HTML>
u am 0
m
!
<HTML>
<HEAD><TITLE>DOEACC CENTRE - Example 15</TITLE></HEAD>
<BODY>
<DIV ALIGN="CENTER">
<B>Formula Table</B>
<P>
<TABLE BORDER=2 CELLPADDING=5>
<TR><TH> Shapes <TH> Name<TH>Formula
<TR ALIGN="CENTER"> <TD> <IMG SRC="TRIANGLE.BMP"> <TD>
Triangle <TD>(Height * Base)/2
<TR ALIGN="CENTER"> <TD> <IMG SRC="CIRCLE.BMP"> <TD>
Circle <TD>Pi * r<SUP>2</SUP>
<TR ALIGN="CENTER"> <TD> <IMG SRC="SQUARE.BMP">
<TD>Square<TD>Side<SUP>2</SUP>
</TABLE>
</BODY>
</HTML>
u am 4
m
a
a u am
my
a r r#$$
r
aara ra.
a
rara ra..
a
a
a
a r r#$$
r
.
.
.
r
r
).
D.
.
r.
a
.
.
r
r
a
a
a .
aaa.
a .
.
.
u.
.
r
.
a .y.
m
!
a
a u am
ra
1
)r a
aa yr a
a
D
a
u
a
)m
")a
".) ,am
"ar.
r
y,am
"Y ar a
" r
a .ra
mmaryDay!0
2 u.u
2 *.*
a
a r
2 D.D
a
a a
a
2 .
a
a a
a
r
ar
2 u am D
r
2 ra
1
Day4
-rm
rma
rm
r a rr a
u ryrm
a
|
a m
r
a
"
"
"
a
" a
r
-rm
a
a
rm
a
r
ar
#$$ ar
r
r
rm
á#$$
rm
r rrmay
ra
r
a
a
m
r a rm
a
r
ar
#$$
y r
a ar )u);
*D] *uu ] -]u a u
#$$
am
m a a
r
#$$ r a
m
a
a = r a r ra
a
m
rm= r r
r m
a r
#$$
r
r a
ma & ( r a ra
a
a
m
"#$$
ara
r a
r
á#$$
ma
mm m r ara
r
a
a
r
a
r
#$$
r
ma
a
#$$
am
a
a
r
"#$$
m r m
ay ] ]u
a
m a r
] ]u
m
$$ a m
rm a
a
a
m
a
m
# $
a
r
y a
#$$
a
m
rm
m
a
am
ryrm m
D a
a
a
r
ar
#$$
am
a
r
%#$$
m r r
ar a
ay
#$$
m r m &ara
r(
ar a
ay
u am 5
m
<HTML>
<HEAD><TITLE>DOEACC CENTRE - Example 16</TITLE></HEAD>
<BODY>
<B><DIV ALIGN="CENTER"> Employment Exchange</DIV></B>
<PRE>
<FORM METHOD="POST"
ACTION="mailto:employmentexchaNge@Chandigarh.com">
First Name : <INPUT NAME="NAM1" TYPE="TEXT" SIZE="25">
Second Name : <INPUT NAME="NAM2" TYPE="TEXT" SIZE="25">
Father's Name : <INPUT NAME="FNAM" TYPE="TEXT" SIZE="50">
Date of Birth : <INPUT NAME="DOB" TYPE="TEXT" SIZE="10">
Sex Code : <INPUT NAME="SC1" TYPE="CHECKBOX"> M <INPUT
NAME="SC2" TYPE="CHECKBOX"> F
Qualification : <SELECT NAME="QUALI">
<OPTION> High School
<OPTION> Intermediate
<OPTION> Graduate
<OPTION> Post Graduate
<OPTION> Engineer
<OPTION> PhD
</SELECT>
u am 5
mm
Stream <SELECT NAME="STR">
<OPTION> Science
<OPTION> Arts
<OPTION> Commerce
<OPTION> Computers
</SELECT>
Percentage Marks : <INPUT NAME="PM" TYPE="TEXT" SIZE="5">
Nationality : <INPUT NAME="NAT" TYPE="TEXT" SIZE="15">
Religion : <INPUT NAME="REG" TYPE="TEXT" SIZE="15">
Category : <SELECT NAME="CAT">
<OPTION> SC
<OPTION> ST
<OPTION> General
<OPTION> OTHERS
</SELECT>
Mailing Address : <INPUT NAME="ADR1.1" TYPE="TEXT" SIZE="50">
<INPUT NAME="ADR1.2" TYPE="TEXT" SIZE="50">
Permanent Address : <INPUT NAME="ADR2.1" TYPE="TEXT" SIZE="50">
<INPUT NAME="ADR2.2" TYPE="TEXT" SIZE="50">
<INPUT TYPE="SUBMIT" VALUE="OK"> <INPUT TYPE="RESET" VALUE="CLEAR">
</PRE>
</FORM> </BODY> </HTML>
u am 5
m
ra
1
)r a
arm
a
r
a ar
)r a
a
- a-rm- aa ra
rma
-
rmar
2 ,am &
(
2 r &
r a(
2 &*a
(
2 )r )
y
&
(
2 ]ra
r
r &Dr
" Va u
r(
2 ]
r
r&*a
!Va u
r(
2 * mar.)mm
&
r a(
2 m
&
(
)r a
a ry-rma
a
a
rm
auma
mmaryDay!4
2 -rm
2 -*.-*
2 ], .],
2 uu).uu)
2 ],
2 u*u.u*u
2 u am D
r
2 ra
1
Day5
-ram rm
m
a
y
r r
m
m
-ram ar
a
a
y a y
a
a ra
r a m
a
a
ay ram a
a
a
a
r ram &r
(
-r am ram
ay a a
a
r ram a a
r a r
-ram ar a
ay a ay arra
a r
ra a a
)r a
a-ram
m
ram
m
aa
a
r
r r
m
ram a
a
ay
a
ram
ma
a
ram
a
a a
aya
ara
m
a
r
ar
%#$$
r ram
r
ay
m r r
y a m r & a '( a
r
a
a
& a +4>( r
a a
r
&?(
a
a
a ram
a a
r ma
a
#$$ r
m
ar
r
a
r ram
r
%
ay
m
#$$ a
ram
Ä #$$
r
ay
r r r
ram
ar y r
Ä #$$
%
ram r r
|
a y a a
a
a
m
ay
a ram
Y '
y
a
a
ram
a
a
r
ar
#$$
*
m
ay
ram
#$$ a am
r
ar
ram
ar
a
r
á
&
<HTML>
<HEAD><TITLE>DOEACC CENTRE ±
Example 17</TITLE></HEAD>
<FRAMESET COLS="20%,75%">
<FRAME SRC="INDEX.HTM">
<FRAME SRC="BLANK.HTM"
NAME="MAIN">
</FRAMESET>
</HTML>
&
y
ram
a
r y a
r a
ra
r m ram ay
,
u am
7
y
ram
u am 7
m
<HTML>
<HEAD><TITLE>DOEACC CENTRE ± Example
18</TITLE></HEAD>
<FRAMESET COLS="20%,80%">
<FRAME SRC="INDEX.HTM">
<FRAMESET ROWS="30%,70%">
<FRAME SRC="LOGO.HTM" NAME="LOGO">
<FRAME SRC="BLANK.HTM" NAME="MAIN">
</FRAMESET>
</FRAMESET>
</HTML>
am 7
m
m
am
a
a
m
a
ar %%r r
a
ra
a
ma
]
a
r
ar
a
a
a
Y a
a
a a
ÄÄ
a
Ä
Ä m a
r a r
ay y a r r
a
r
ar
#$$ *
m
%
á#$$
m -
á
á #$$
m -
#$$
rm
a
m
m
a
#$$
a
m
a a
a r
á#$$
a
m
a a
r
r
Ä #$$ ra a r r
%
ar
m
a
'
<HTML>
<HEAD><TITLE>DOEACC CENTRE - Example
19</TITLE></HEAD>
<BODY>
<EMBED SRC="FIRST.AVI" AUTOSTART="TRUE"
LOOP="TRUE" WIDTH =160 HEIGHT=120
VSPACE =10 HSPACE=20 ALIGN="LEFT">
You are listening the First Music file.
</BODY>
</HTML>
am 9
m
ra
1
2 )r a
a V r
a ram
/
r
m
2 )r a
a ram
+ r a
r +
m
2 )r a
a ,a
a
-ram
ram
r
ar
*
r
ram
2 )r a
a ram
3m
a
ram a
a
2 )r a
a | a
a
mmaryDay!5
2 -ram
2 )r a
a-ram
m
2 -*uu.-*uu
2 -*u.-*u
2 ,
-ram
2
m
am
a
a
2 uuD
2 u am D
r
2 ra
1
Day'
DYNA
Dyam
&D( raay
r
a
a
)m
)aa
y
a
r
a a D
ar
rr a
y !a
a
m
a
y
"
y
a
a rm
r
a
a
r
a ara may a a
y a
m
r
ar
a
a a
a
a
y
a r ma
a
m
m
a y
a
y a
a
y a y a
a
a a
r ry ra
]
ra
y ma
a
m
r
y a
r
3
=
G
÷H
÷IJ
!5#0
·
]
y
rm
y
" a
a
r a ry
ry ra
a ara
"
r ara
a
r
a a r
"
y
a
a a
r! ara
r a
a
r ' a am a
r! ara
r
" @rr
m =
!am
ya
r }
r
a
ay a
a r
m
a
!raa
ra
!a
·
]
'
r a
r
mr
a
a
"
a
a + @a
r
a }
]
a
r a
a
r
!a
a -r
am
r
" u @rr
m}
r
m a
r a a
a a u
& ma
% ( m
] y m
a a y '
|
'r a
' a a r a a a
ua
a ] m
m a a
r
a
a
r a
a
/ 1÷
/ - ÷
/ - ]1
/ !2-:
/ 2
÷!
Day7
y
-r
y
rma
r a a '
a ara
'
ary r
a
y
a ar
a
]
a y a
y
a ara
m
a
a
a
m
YuY u#$ .C
*@
4=r }
.Yu
y
1
, a
r |
a
a
y
m
] yr
y
% |
a
m m
r a
a
-
r
.á
a
&
y
rma
r
m
(
y
#
y
#B
.C
á # $-]Vu!
m$
#$
y $
u a
y a
y a
r
ar aa
a
yA
r
m
mr y Y' r
% m
m a y' ar ay
r
D
a
ry
ara
r
-
!am
y
-
!
y -
!
-
!
%
r
raa r
m
)r a r
a r!r a r!
ma
a r!r a
a r!a
am
a r!
r
r r
a m
r!a
r!a
! ra
r
a!a
!
rarm
!a
!
!a
a
r a
ara
r
&m
m
($ $
a
ar
ar
!
ar
!r
ar
!
m ar
!
a
a
!
a
!r
a
!
m
a
!
r r!
r r!
!
r r!r
!
r r!
m!
r r!
!
] y
ar $
y
r
Yr r r$ y' a rama
am
(
a
r
ar
!am
y
!
y
!
!
% a &
rr
y(
a
a
a r
a
r
r r
ra
ara
r
a
am
m
1
a
a
r
a
r
-
!am
y mma!
m
D
am
y
am &
r
a( a.r
& r
a! r
r
a
ay r
ma (
-
!
y ,rma
a
r
D
-
!
,rma r
r r
m r
a a
&:: +:: /:: 0:: 4:: 5:: ':: 7:: r
9::(
-
!
%
rm
a
a
% & !ma !
ma ma m
m ar !ar !ar (
r a
% &ar ma r( a m r &
(
r a r
a
ar
m
'
% (
Ä
r
a
ry
y
a ara a m
'
r r a a r
m r a
ma
a r a
r
a r
a r
ra
a r a
r
a a
a m
r
%
|r!a
]r a
a
a
,rmara
r
r!a
]r a
a
a
,rmara
r
! ra
' ra
a m
, r rmr
rm r
r
r
V r
a!a
D
rm
a m
' r
a
a
r
!
m
mr
m=aa a
r
a
m
!
rarma
a
rarma
)a
a
% &
aa(
ra ra r
!a
m
r
rr-
y
!
]
r
r
a
m
ra
!
D
rm
a
,rmaram r
r r
a
a
m
'
%
,
u am
a
r
!r a rm
a
+'
a
a
a
4:
rm
a +:
rm
y
a
a
u am 5
m a y'
ay
u am 5
<HTML>
<HEAD>
<TITLE>Positions</TITLE>
</HEAD>
<BODY>
<BR><BR><BR>
This is line 1
<SPAN Style =
"position:absolute;top:50;left:20">
This is line2 with absolute positioning.
</SPAN>
</BODY>
</HTML>
)a
u am 5
m
,
' a
+ rm a
r a
r a
m
r a
m
a
r
m
+
4:
rm
a+:
r
ra
1
2 )r a
y
a
a
m
a
r
m
2 )r a
y r
a m r
(
/ # !
÷!
/ 0÷
!5#0
/ *
-
/ -
/ 2
/ 2
÷!
Day9
]
r
ð
ð
ð
ð
ð
è
ð
&! !!#
'(
)
!
#ð'(
$
ð &!ð
%
ð
u/
ð
* # ''
)
!
#''
$ ð *ð
%
ð
!###
ð
)
!
#ð'($
ð &!ð
%
#'(..ð'/$
ð &
ð %
$
ð ð
%
ð
M
+ Addition x=2 4
y=2
x+y
- Subtraction x=5 3
y=2
x-y
* Multiplication x=5 20
y=4
x*y
/ Division 15/5 3
5/2 2.5
= x=y x=y
+= x+=y x=x+y
-= x-=y x=x-y
*= x*=y x=x*y
/= x/=y x=x/y
%= x%=y x=x%y
%
% D u
UU and x=6
y=3
(x < 10 UU y > 1) returns
true
|| or x=6
y=3
(x==5 || y==5) returns
false
! not x=6
y=3
!(x==y) returns true
%
Alert box
Alert box with line breaks
Confirm box
Prompt box
A&
(
!&
(
confirm("sometext")
'&
A prompt box is often used if you want the
user to input a value before entering a
page.
When a prompt box pops up, the user will
have to click either "OK" or "Cancel" to
proceed after entering an input value.
If the user clicks "OK" the box returns the
input value. If the user clicks "Cancel" the
box returns null.
(
prompt("sometext","defaultvalue")
M 3
<html>
<body>
<script type="text/javascript">
var i=0
for (i=0;i<=10;i++)
{
if (i==3){continue}
document.write("The number is " + i)
document.write("<br />")
}
</script>
</body>
</html>
3###
The for...in statement is used to loop (iterate) through
the elements of an array or through the properties of
an object.
The code in the body of the for ... in loop is executed
once for each element/property.
for (variable in object)
{
}
for (x in mycars)
{
document.write(mycars[x] + "<br />")
}
</script>
</body>
</html>
ra
1
2 |r
a r
a
a
yr am
a
a
ay
a
am
a a
2 |r
a r
a
ay
a
r
a a m r
2 |r
a r
a
ay
r
m m r rm
::
!D..
2M
Ä
2 Ä
2
Ä
2 Ä
2M
2á
2
2M
2
2
2
2
2
2
2
Day+
u
19
% %
Methods are the actions that can be performed on objects
%,
am
r)a &(m
r
-
r
a
r
ra
r
var txt="Hello world!"
document.write(txt.toUpperCase())
D%,
The Date object is used to work with dates and times.
We define a Date object with the new keyword. The following
code line defines a Date object called myDate:
)
)
following output:
5
function getCookie(c_name)
{
if (document.cookie.length>0)
{
c_start=document.cookie.indexOf(c_name + "=")
if (c_start!=-1)
{
c_start=c_start + c_name.length+1
c_end=document.cookie.indexOf(";",c_start)
if (c_end==-1) c_end=document.cookie.length
return
unescape(document.cookie.substring(c_start,c_end))
}
}
return null
}
u
the function that displays a welcome message if the cookie is set, and if
the cookie is not set it will display a prompt box, asking for the name of
the user
function checkCookie()
{
username=getCookie('username')
if (username!=null)
{alert('Welcome again '+username+'!')}
else
{
username=prompt('Please enter your name:',"")
if (username!=null||username!="")
{
setCookie('username',username,365)
}
}
}
3è
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
{alert(alerttxt);return false}
else {return true}
}
}
u
u4è
The function below checks if the content has the general
syntax of an email
function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@")
dotpos=value.lastIndexOf(".")
if (apos<1||dotpos-apos<2)
{alert(alerttxt);return false}
else {return true}
}
}
ra
1
2 )r a
a rm a
ay a rrr m a m
ar m
y
2 )r a
a
a
r
r am a ar
2 |r
a r
r
r
rma
!D.7
M
3è
063
'
Day0
| A '$
| A '$
| A '3$
DA 'D!!!
$
| A '!$
'| A '|-:
'
Day4
& 0
An ASP file normally contains HTML tags,
just like an HTML file. However, an ASP
file can also contain ,
surrounded by the delimiters < and
<. Server scripts are
and can contain any
expressions, statements, procedures, or
operators valid for the scripting
language you prefer to use.
0%,
The | method of the ASP
0%, is used to send
content to the browser. For example,
the following statement sends the text
"Hello World" to the browser:
<%
response.write("Hello World!")
%>
è&
To set MavaScript as the default scripting language for
a particular page you must insert a language
specification at the top of the page:
<%@ language="javascript"%>
<html>
<body>
<%
Response.Write("Hello World!")
%>
</body>
</html>
M
To set MavaScript as the default scripting language for
a particular page you must insert a language
specification at the top of the page:
<%@ language="javascript"%>
<html>
<body>
<%
Response.Write("Hello World!")
%>
</body>
</html>
A 'è
A variable is used to store information. If the variable is declared
outside a procedure it can be changed by any script in the ASP
file. If the variable is declared inside a procedure, it is created
and destroyed every time the procedure is executed
<html>
<head>
<%
sub vbproc(num1,num2)
response.write(num1*num2)
end sub
%>
</head>
<body>
<p>Result: <%call vbproc(3,4)%></p>
</body>
</html>
ra
1
2 |r
a r
a
ay m
m r + a
/0
2 |r
a r
a
ay
a ra 4 m r
!D.9
3(
<form method="get" action="simpleform.asp">
First Name: <input type="text" name="fname" />
<br />
Last Name: <input type="text" name="lname" />
<br /><br />
<input type="submit" value="Submit" />
</form>
06#=
* D
ry
r
mma
a
arm
m
#$
$]rma
rmarm
um
ry &
ay
r r'ar ar(aa
m
am
rma
]a r
y $
$a$a
$
rm am a
*
r r
http://www.mysite.com/simpleform.asp?fname=Bill&lname=Gates
u
<body>
Welcome
<%
response.write(request.querystring("fname"))
response.write(" " & request.querystring("lname"))
%>
</body>
06#3
* D
-rmmma
a
arm
m
#$
$
]rma
rmarm
m
raa
m
am
rma
]a r
y $
$a$a
$
rm am a
*
r r
http://www.mysite.com/simpleform.asp
m
a
$
m rma$
a
r
<body>
Welcome
<%
response.write(request.form("fname"))
response.write(" " & request.form("lname"))
%>
</body>
ra
1
Interact with a user in a form that uses the "get"
method
Interact with a user in a form that uses the "post"
method
Interact with a user in a form with radio buttons
!D.;
Functions
User Input
Request.QueryString
Request.Form
Practical Session
Day'
A '
A cookie is often used to identify a user.
A cookie is a small file that the server
embeds on the user's computer. Each
time the same computer requests a
page with a browser, it will send the
cookie too. With ASP, you can both
create and retrieve cookie values.
<%
Response.Cookies("user")("firstname")="John"
Response.Cookies("user")("lastname")="Smith"
Response.Cookies("user")("country")="Norway"
Response.Cookies("user")("age")="25"
%>
u
<html>
<body>
<%
dim x,y
for each x in Request.Cookies
response.write("<p>")
if Request.Cookies(x).HasKeys then
for each y in Request.Cookies(x)
response.write(x & ":" & y & "=" &
Request.Cookies(x)(y))
response.write("<br />")
next
else
Response.Write(x & "=" & Request.Cookies(x) & "<br />")
end if
response.write "</p>"
next
%>
</body>
</html>
ra
1
2 )r a
a rm a
ay a rrr m a m
ar m
y
2 )r a
a
a
r
r am a ar
2 |r
a r
r
r
rma
!D.?
ASP Cookies
How to Create a Cookie
Retrieve a Cookie Value
A Cookie with Keys
Practical Session
Day7
| !&DN%
$
/ !
)
/ 8
!
!
K
/ 8
!
0 K
/ !
+
!
F÷
/ +!
F÷
/ #
%
%÷÷
/ 0÷
/ !
4)
%÷÷
/ 2
÷!
Day+:
@#!
The Global.asa file is an optional file that can contain
declarations of objects, variables, and methods that
can be accessed by every page in an ASP application.
All valid browser scripts (MavaScript, VBScript, MScript,
PerlScript, etc.) can be used within Global.asa.
The Global.asa file can contain only the following:
Application events
Session events
<object> declarations
TypeLibrary declarations
the #include directive
u@#
In Global.asa you can tell the application and session objects what
to do when the application/session starts and what to do when the
application/session ends. The code for this is placed in event
handlers. The Global.asa file can contain four types of events:
AA% - This event occurs when the FIRST user
calls the first page from an ASP application. This event occurs after
the Web server is restarted or after the Global.asa file is edited.
The "Session_OnStart" event occurs immediately after this event.
A% - This event occurs EVERY time a NEW user
requests his or her first page in the ASP application.
A%u - This event occurs EVERY time a user ends a
session. A user ends a session after a page has not been requested
by the user for a specified time (by default this is 20 minutes).
AA%u - This event occurs after the LAST user has
ended the session. Typically, this event occurs when a Web server
stops. This procedure is used to clean up settings after the
Application stops, like delete records or write information to text
files.
r
r E aaa
/,÷÷
÷
/0
,÷÷
/!
L ÷÷
M
/!÷,÷÷
÷
/+
Day+
A%,
An application on the Web may be a group of ASP
files. The ASP files work together to perform some
purpose. The Application object in ASP is used to tie
these files together.
The Application object is used to store and access
variables from any page, just like the Session object.
The difference is that ALL users share one Application
object, while with Sessions there is one Session
object for EACH user.
The Application object should hold information that
will be used by many pages in the application (like
database connection information). This means that
you can access the information from any page. It
also means that you can change the information in
one place and the changes will automatically be
reflected on all pages.
0Aè
Sub Application_OnStart
application("vartime")=""
application("users")=1
End Sub
</script>
0Aè
If you do not know the number of items in the Contents collection, you can use the
Count property:
<%
dim i
dim j
j=Application.Contents.Count
For i=1 to j
Response.Write(Application.Contents(i) & "<br />")
Next
%>
%,
/
/
/
/ Ñ
Ñ
/
Ñ
/
/
/
Day++
4 D% Y
D% Y 4A '#
4 A '#
<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="mymail@mydomain.com"
myMail.To="someone@somedomain.com"
myMail.TextBody="This is a message."
myMail.AddAttachment
"c:\mydocuments\test.txt"
myMail.Send
set myMail=nothing
%>
ra
1
Write a program to send a mail
Write a program to send a HTML mail
Write a program to send a mail with attachment
Sending a text e-mail with Bcc and CC fields
!D//
ÑÑ
/
/
/
/
Day+/
%,
The TextStream object is used to access the contents of
text files.
The following code creates a text file (c:\test.txt) and then
writes some text to the file (the variable f is an instance of
the TextStream object):
<%
dim fs, f
set
fs=Server.CreateObject("Scripting.FileSystemObject
")
set f=fs.CreateTextFile("c:\test.txt",true)
f.WriteLine("Hello World!")
f.Close
set f=nothing
set fs=nothing
%>
u
The ReadAll method of the TextStream Object reads from the
opened text file
<html>
<body>
<p>This is the text in the text file:</p>
<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile(Server.MapPath("testread.txt"), 1)
Response.Write(f.ReadAll)
f.Close
Set f=Nothing
Set fs=Nothing
%>
</body>
</html>
u
read one line from a TextStream file.
<html>
<body>
<p>This is the first five characters from the text file:</p>
<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile(Server.MapPath("testread.txt"), 1)
Response.Write(f.Read(5))
f.Close
Set f=Nothing
Set fs=Nothing
%>
</body>
</html>
A0
m
y
>
ar
a
r# r r)r a
-
&$|)*
a
r$(
r r
&ar
a
r
r
m
&$a
$((
>
.y
.
m
)
1
The file "ads.txt" looks like this
?
/
../m.
V
|/
7:
m
r
..m
r
m.
V
r
+:
The lines below the asterisk in the file "ads.txt" specifies
the images to be displayed, the hyperlink addresses, the
alternate text (for the images), and the display rates in percent
of the hits. We see that the W3Schools image will be displayed
for 80 % of the hits and the Microsoft image will be displayed
for 20 % of the hits in the text file above.
)
1
To get the links to work when a user clicks on them, we will have to
modify the file "ads.txt" a bit:
*uD]*u)a ra
?
/
../m.
V
|/
7:
m
r
..m
r
m.
V
r
+:
The redirection page (banners.asp) will now receive
a querystring with a variable named URL containing
the URL to redirect to.
ra
1
Write a program to read textfile
Write a program to read only a part of a textfile
Write a program to read one line of a textfile
Write a program to read all lines from a textfile
!D/7
/
Ñ
/
Day+0
AD%
AD%
!#
| AD%$
&!
!
#
D N4D
<%
K5K
- B)-)H
J
%,'
' D
D
/ ]
/
/
/ Ñ
/ Ñ
/ Ñ
/ Ñ
u
/
Day+4
AD%0
!
#
AD%
0
After an ADO Database Connection has been created, as
demonstrated in the previous chapter, it is possible to create an
ADO Recordset.
Suppose we have a database named "Northwind", we can get
access to the "Customers" table inside the database with the
following lines:
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"
set rs=Server.CreateObject("ADODB.recordset")
rs.Open "Customers", conn
%>
AD% =
0
We can also get access to the data in the "Customers"
table using SQL:
<%
set
conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"
set rs=Server.CreateObject("ADODB.recordset")
rs.Open "Select * from Customers", conn
%>
uD!
0
After a recordset is opened, we can extract data from recordset.
Suppose we have a database named "Northwind", we can get access
to the "Customers" table inside the database with the following lines:
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"
set rs=Server.CreateObject("ADODB.recordset")
rs.Open "Select * from Customers", conn
for each x in rs.fields
response.write(x.name)
response.write(" = ")
response.write(x.value)
next
%>
AD%0%,
The ADO Recordset object is used to hold a set of
records from a database table. A Recordset object
consist of records and columns (fields).
In ADO, this object is the most important and the
one used most often to manipulate data from a
database.
ðJ
= 5K
- B)-)H J
/ -14+
/ %
-14÷+
/ %
-14!N#+
/ 0
1
+
/ -14+
4)
/ 2
÷!
Day+5
AD%04'
' D
AbsolutePage Sets or returns a value that specifies the page number in
AbsolutePosition the
SetsRecordset
or returnsobject
a value that specifies the ordinal position of
the current record in the Recordset object
ActiveCommand Returns the Command object associated with the
Recordset
ActiveConnection Sets or returns a definition for a connection if the
connection is closed, or the current Connection object if
BOF the connection
Returns is open
true if the current record position is before the
Bookmark first
Sets record, otherwise
or returns false The bookmark saves the
a bookmark.
CacheSize position of the current
Sets or returns record
the number of records that can be cached
CursorLocation Sets or returns the location of the cursor service
/
/
/
u
/
Ñ
Day+'
AD%D
!
#
u
D
How to first create a database connection, then a recordset, and
then display the data in HTML.
D
How to display the data from the database table in an HTML
table.
A
How to add headers to the HTML table to make it more readable.
A
How to add colors to the HTML table to make it look nice.
u am ! Display records
How to first create a database connection, then a recordset, and then display the data in
HTML.
<html> <body>
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Met.OLEDB.4.0"
conn.Open(Server.Mappath("/db/northwind.mdb"))
set rs = Server.CreateObject("ADODB.recordset")
rs.Open "Select * from Customers", conn
do until rs.EOF
for each x in rs.Fields
Response.Write(x.name)
Response.Write(" = ")
Response.Write(x.value U "<br />")
next
Response.Write("<br />")
rs.MoveNext
loop
rs.close
conn.close
%>
</body> </html>
u am + !Display records in an HTML table
How to display the data from the database table in an HTML table.
ð
ð
ð
Ñ
Ñ
!
" u#$
Ñ
!
uuÑÑ
%Ñ
Ñ
%
ð
ð
ð
! Add headers to the HTML table
How to add headers to the HTML table to make it more readable.
<html> <body>
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Met.OLEDB.4.0"
conn.Open(Server.Mappath("/db/northwind.mdb"))
set rs = Server.CreateObject("ADODB.recordset")
sql="SELECT Companyname, Contactname FROM Customers"
rs.Open sql, conn
%>
$=
=P P=3
=&
O3
O
÷
04*O
O
*÷
O
O+
8
$÷&O3
O
:
O
3
O÷
÷
÷
O3
÷33
÷
!Sort the records on a specified fieldname ascending
How to sort the data on a specified fieldname.
÷
O
<!%
4)
$=-141.%
=&
2<=
4#01.>?=
4 =3
3
=
<!%
4)
$=-141.
=&
'÷<=!0#0%% %
*+4
%
4+10+.5% :=
4
'÷
O
÷<=6=
<=6??O=
O
*÷
$=
=P P=3
=&
O3
O
÷
04*O
O
*÷
O
O+
8
$÷&O3
O
:
O
3
O÷
÷
÷
O
3
÷33
÷
Display records where "Companyname" is > E
How to display only the records from the "Customers" table
that have a "Companyname" that is larger than E.
Display only Spanish customers
How to display only the Spanish customers from the
"Customers" table.
Let the user choose filter
Let the user choose which country to show customers from.
Sort the records on a specified fieldname ascending
How to sort the data on a specified fieldname.
Sort the records on a specified fieldname descending
How to sort the data on a specified fieldname.
Let the user choose what column to sort on
!D/?
/
/ u& 1
÷
/ u'1
÷
"#
÷
"
÷
÷ "#
÷
/ u( -
"#
÷
"
"#
÷
÷
/ u#-÷
"#
÷
"
÷
"#
÷
÷
/ u)1
÷
=% =
-"
÷ ÷
=%
=
÷
=% =
-
/ u*!
÷
"
÷
/
Day+7
AD%A0
We may use the SQL INSERT INTO
command to add a record to a table in a
database
Add a Record to a Table in a Database
We want to add a new record to the
Customers table in the Northwind
database. We first create a form that
contains the fields we want to collect
data from.
ð
u am ! -rm
ð
ð
ð
ð
ð
ð
ðð
ð
ðð
ð
ð
ðð ð
ðð
ð
ð
ðð ð
ðð
ð
ð
ðð
ð
ðð
ð
ð
ðð ð
ðð
ð
ð
ðð
ð
ðð
ð
ð
ðð ð
ð
ð
ðð
ð
ð
ð
ð
ð
'÷<=]:!0+]:4
$
]1 =
'÷<
'÷P=
÷
&=
'÷<
'÷P=F-#90!=
'÷<
'÷P=$7=P+'
*$=
=&P=7=
'÷<
'÷P=7=P+'
*$= =&P=7=
'÷<
'÷P=7=P+'
*$=
=&P=7=
'÷<
'÷P=7=P+'
*$=
=&P=7=
'÷<
'÷P=7=P+'
*$=
=&P=7=
'÷<
'÷P=7=P+'
*$=
=&P=7=
'÷<
'÷P=7=P+'
*$=
=&P=7&=
0
'÷
?
+
8
$=:
Q=&
÷
+
8
$=C=P
P=3C=&
÷
O33
÷
If you use the SQL INSERT command be
aware of the following:
If the table contains a primary key, make
sure to append a unique, non-Null value to the
primary key field (if not, the provider may not
append the record, or an error occurs)
If the table contains an AutoNumber field, do
not include this field in the SQL INSERT
command (the value of this field will be taken
care of automatically by the provider)
| 3| D$
In a MS Access database, you can enter zero-
length strings ("") in Text, Hyperlink, and
Memo fields IF you set the AllowZeroLength
property to Yes.
N( Not all databases support zero-length
strings and may cause an error when a record
with blank fields is added. It is important to
check what data types your database
supports.
AD%º0
| =
º'DAu
#
º0
We want to update a record in the Customers table in the Northwind database.
We first create a table that lists all records in the Customers table:
<html> <body>
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"
set rs=Server.CreateObject("ADODB.Recordset")
rs.open "SELECT * FROM customers",conn
%>
<h2>List Database</h2>
<table border="1" width="100%">
<tr>
<%
for each x in rs.Fields
response.write("<th>" & ucase(x.name) & "</th>")
Next %>
º0contd·
3
O
÷
04*O
<=
=
<=R
=
O
*÷
÷
$ &<=
=
O
<=
= <=
]1=÷<=O<÷O=
3
O÷
O
O+
8
$÷&O3
O
O
3
O
:
O
3
O
÷
÷
O
3
÷
33
÷
º0contd·
If the user clicks on the button in the "customerID" column he or she will be
taken to a new file called "demo_update.asp". The "demo_update.asp" file
contains the source code on how to create input fields based on the fields from
one record in the database table. It also contains a "Update record" button that
will save your changes:
÷
E9
+3E
O
<!%
4)
$=-141.%
=&
2<=
4#01.>?=
4 =3
3
=
<+'
*$=
]1=&
+'
$= =&<==
<!%
4)
$=-141.+
=&
=!0#0%S*+4
8"0+0
]1<7=PP=7=
O
<=
=
<=R
=
÷
O
*÷
O
O< O3
<=O< O=÷<=O<÷O=3
O
O
3
3
÷
33
<=
=÷<=9
=3
º0contd·
<%
else
sql="UPDATE customers SET "
sql=sql & "companyname='" & Request.Form("companyname") & "',"
sql=sql & "contactname='" & Request.Form("contactname") & "',"
sql=sql & "address='" & Request.Form("address") & "',"
sql=sql & "city='" & Request.Form("city") & "',"
sql=sql & "postalcode='" & Request.Form("postalcode") & "',"
sql=sql & "country='" & Request.Form("country") & "'"
sql=sql & " WHERE customerID='" & cid & "'"
on error resume next
conn.Execute sql
if err<>0 then
response.write("No update permissions!")
else
response.write("Record " & cid & " was updated!")
end if
end if
conn.close
%>
</body> </html>
|0
|0
!D/:
/
/ u
/
+
/ ]
/
/
/
/
Day+9
AD%D0
| =
Du
uu
#
D0
We want to delete a record in the Customers table in the Northwind
database. We first create a table that lists all records in the
Customers table:
<html> <body>
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"
set rs=Server.CreateObject("ADODB.Recordset")
rs.open "SELECT * FROM customers",conn
%>
<h2>List Database</h2>
<table border="1" width="100%">
<tr>
<%
for each x in rs.Fields
response.write("<th>" & ucase(x.name) & "</th>")
next
%> </tr>
D0contd..
O
÷
04*O
<=
=
<=R÷
=
O
*÷
<=
]1=
O
<=
= <=
]1=÷<=O<÷O=
3
O÷
O
O+
8
$÷&O3
O
O
3
O
:
O
3
O
÷
÷
O
3
÷33
÷
D0contd..
If the user clicks on the button in the "customerID" column he or she will be
taken to a new file called "demo_delete.asp". The "demo_delete.asp" file contains
the source code on how to create input fields based on the fields from one record
in the database table. It also contains a "Delete record" button that will delete the
current record:
<html>
<body>
<h2>Delete Record</h2>
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"
cid=Request.Form("customerID")
if Request.form("companyname")="" then
set rs=Server.CreateObject("ADODB.Recordset")
rs.open "SELECT * FROM customers WHERE customerID='"
& cid & "'",conn
%>
D0contd..
<=
=
<=R÷
=
÷
O
*÷
O
O< O3
<=O< O=÷<=O<÷O=3
O
O
3
3
÷
33
<=
=÷<=1÷
=
3
O
÷
'÷<=10#00*+4
=
'÷<
'÷P=8"0+0
]1<7=PP=7=
0
'÷
?
$=:
Q=&
÷
$=+=PP=
÷
Q=&
÷
O33
÷
4 !
A$
/
/
/
Day/:!*