
11/17/02
Currently
being Updated!
COSC 330
LEARNING MODULE
IV
AUTHORING COMPLEX
HTML/XHTML PAGES
This
learning module is a continuation of the study, begun in LM III, of
HTML and its successor, XHTML, from a practicioner's point of view.
It is the SECOND of a two module presentation of HTML; in this LM
IV we consider the authoring of composite pages consisting complex elements
(tables, frames, forms, and server side includes) and multimedia...
Note
that the concise, tabulated presentation of HTML tags in the LM is intended
to be an alternative to that of the textbook and Web references that complements
those formats. (See the Study Guide
for this learning module.) Tell me what you think.
The
Objectives of this learning module are to:
-
learn how page elements (graphics,
multimedia outputs, tables, frames, forms, applets, and SSI) are incorporated
into HTML documents.
-
become
"familiar" with the HTML tags that implement these page elements.
This means be able to:
-
recognize
all tags,
-
be
able to modify their HTML code, and
-
know
where to look up their syntax if necessary.
-
develop
a feeling of when and how these page elements are most effectively incorporated
into Web pages.
TPQ
1: Rewrite the preceding objectives in terms of personal accomplishments
to be attained after finishing the study of this learning module.
This
LM follows the sequence of chapthers in Niederst, Web Design in a Nutshell,
but edits out older, deprecated tags as well as most of those tags that
are browser dependent. The sequence of presentations in this learning
module is as follows. You can click on any link to jump directly
to that section.
-
INSERTING PAGE ELEMENTS
AND JAVASCRIPT
-
HTML FOR TABLES
-
HTML
FOR FRAMES
-
HTML
FOR FORMS
-
SERVERSIDE
INCLUDES (SSI)
INTRODUCTION
After
learning how HTML handles text in LM III, LM IV cover the rest of the
elements that make up a Web page when displayed in a browser.
Most of these elements (Exceptions include scripts, audio clips, and SSI.)
are external ________(1) that the browser loads, following the HTML
link, into RAM and inserts into the brower's display of the HTML
document. It is important to note that an HTML document does NOT
contain anything other than formatted text, scripts, and links to external
files. It is
only when a page is displayed by a browser that
the page elements other than text are inserted at the link location
in the displayed document. The browser executes the "markup instructions"
specified by the ______ ____(2) embedded within the text of the
HTML document. The most frequently used tags can be inserted using
a WYSIWYG authoring tool, however the tags that can be
automatically inserted (using menus and dialog boxes) depends not only
the type of Browser but also on the version of the particular browser.
This browser/version dependency combined with the fact that many tags are
not automatically inserted by authoring tools makes it advisable for Web
developers to be familiar with all HTML tags and be able to quickly look
up the syntax for inserting such tags into their documents.
SAQ
1: What are the two browsers whose differences most affect HTML design?
1.
INSERTING PAGE ELEMENTS AND JAVASCRIPT (
See
Niederst,
Chap. 9 .):
-
HTML documents are essentially _________ _____(3) documents
with links. One use of the links is to designate
external
files that are inserted at the link location when a browser displays
the the HTML document. Such page elements include:
-
horizontal rules (actually a simple graphic)
-
multimedia (graphic images, audio consoles, and video)
-
Java applet displays
-
Also included here are elements that
do not necessarily display such as:
-
audio clips
-
JavaScript scripts, which are embedded within HTML
documents, that provide client-side programs; they are used to add
interactivity and animation to a Web page.
-
The new HTML 4.0 specification has an all-purpose
tag, <object>, for embedding
links to objects such as images, Java applets, plug-in displays, ActiveX
controls, etc. This is supposed to supercede the following tags:
-
<applet> (deprecated in
HTML 4.0) which displays, in a definable window, the
input to and output from a Java applet.
-
<embed> which inserts,
within HTML text, a link to an object (typically a multimedia file
that often requires a _______(4) to activate) which will be placed
at that point when the document is displayed in a browser.
-
The horizontal rule, the simplest non-text page element,
is a block-level element (always creates a line break above and
below). It is typically used as a page divider separating distinct
presentations. Attributes allow the length/width, alignment, and
3D shading to be controlled. If one desires interesting rules, GIF
icons can be used instead of HTML rules.
-
Images are typically external _____, ______,
or _____(5) files that are inserted, at their HTML link <img>,
by the browser.
-
In additions to illustrations, images can be used
as hyperlinks, spacers/dividers, for imagemaps (a
graphic with "hot spots" that contain hyperlinks) as well as providing
varieties
of text.
-
GIF images can be animated. Animated GIFs are
not distinguishable by their file name.
-
There are currently 12 standard attributes that govern
the appearance, size, alignment, downloading, use as an imagemap.
Other nonstandard attributes are recognized by particular browsers.
-
The use of images in Web pages is covered in more detail
in LM V, MULTIMEDIA IN WEB PAGES
and
Niederst,
Part III.
-
Java _______(6)
are the most sophisticated way to introduce dynamics and interactivity
to a Web site. Java, a very sophisticated, moder object oriented
programming language, is beyond the scope of this course. On the
other hand, precoded Java applets are easily incorporated into Web pages.
-
Applets are incorporated into
Web pages by "calling the programs" with the <applet>
tag (deprecated in HTML 4.0 in favor of the _______(7)
tag).
-
A survey of how to use Java
applet technology is presented in LM
VI, JAVA AND JAVASCRIPT.
-
Multimedia files requiring
plug-ins (e.g. Quicktime videos, Flash animations, RealAudio sound
tracks, etc.) may be incorporated into an HTML document by using the<embed>
tag(In
HTML 4.0 the _______(8) tag
is the recommended replacement of the <embed> tag.)
-
When a browser
reads an <embed>tag, the browser matches the _____(9)
type of the multimedia file (e.g. .au, .mov, .midi, etc.) with the appropriate
plug-in (designated,
in the browser preferences to handle such files).
-
The <embed>tag
can, in addition to standard attributes, contain plug-in specific attributes
for controlling the behavior of the particular player. Examples of
media-specific controls include loop, autostart, autoplay, and volume.
-
The displays of
embedded objects, relative to surrounding text, resemble that of inline
images.
-
The basic syntax
of an embedded file is:
<embed src="url"
width="144" height="60" align="center">
-
Example: playing audio
file (.au) with a displayed audio console.
<embed src="someaudiofile.au"
autostart="false" volume="100" width="144" height="60" controls="console"
align="top">
-
The following table relates and
describes the standard tags/attributes of tags associated with general
page elements; tags for elements such as tables, frames, forms, and server
side includes are presented in subsequent sections.
SAQ
2: What is the (a) similarity and (b) difference in the way Java applets
and multimedia are incorporated in Web pages?
SAQ
3: What is the (a) similarity and (b) difference between JavaScript scripts
and Java applets?
PAGE ELEMENT TAGS
|
TAG
|
ATTRIBUTES
|
DESCRIPTION
|
<object>...
</object> |
align=left|center|right|
texttop|middle|textbottom|baseline
data=url
usemap=url
(URL of client-side imagemap)
classid=url
(class to be instantiated)
codebase=url
(URL where code is available
codetype=codetype
(media type of code)
type=type
(media type of data)
name=text
declare (declares object
without instantiatiating it)
shapes (indicates object
has client-side imagemap)
standby=message
(gives message while loading)
border=number
height=number
width=number
hspace=number
vspace=number |
the preferred all-purpose
embedding tag in HTML 4.0 |
| <img> |
src=url
(source URL; only required attribute)
lowsrc=url
(image that will download first)
usemap=url
(URL of client-side imagemap)
ismap (indicates graphic
is a client-side imagemap)
name=text
alt=text
align=left|center|right|
middle|top|bottom|texttop|baseline|
abstop|absbottom
height=number
width=number
hspace=number
vspace=number
border=number |
inserts a graphic image within the page text
|
<embed>...
</embed> |
src=url (source
URL)
pluginspage=url
(URL of required plugin)
name=text
align=center|left|right
palette=foreground|background
height=number
width=number
hspace=number
vspace=number
hidden=yes|no
units=pixels|en
(units of height and width) |
embeds, within HTML, an object (typically a multimedia
file that requires a plug-in to activate)
deprecated in favor of <object>
in HTML 4.0 |
<marquee>...
</marquee> |
align=top|middle|bottom
behavior=scroll|slide|alternate
direction=left|right
bgcolor="#rrggbb"
or color name
heitht=number
width=number
hspace=number
vspace=number
scrollamount=number
scrolldelay=number
loop=number|infinite |
a rectangular space for displaying dynamic or scrolling
banners
only available in I.E.;
not in HTML 4.0 specifications |
<applet>...
</applet> |
align=left|center|right
alt=text
(text alternative if applet can not be displayed)
code=class
(name of the Java applet ot be executed)
codebase=url
(URL where code is available
name=text
height=number
width=number
hspace=number
vspace=number |
displays, in definable window, the I/O interface
of a Java applet
deprecated in favor of <object>
in HTML 4.0 |
<param>...
</param> |
name=text
value=text
type=type
(media type of data; I.E. only)
valueype=data|ref|object(I.E.
only) |
specifies values of parameters within <applet>
or
<object>tags |
<script>...
</script> |
type=content type
(scripting language) |
used to encapsulate embed scripts, e.g. ________(10)
in HTML |
<bgsound>...
</bgsound> |
src=url
loop=number|infinite |
|
| <hr> |
align=center|left|right
noshade
size=number
width=number or % |
inserts a horizontal rule into page |
| <spacer> |
type=vertical|horizontal|block
align=value
(values same as <img>
tab)
size=number
height=number
width=number |
inserts specified amount of blank space |
<noembed>...
</noembed> |
|
|
<noscript>..
</noscript> |
|
|
SAQ
4: Which tag must be encapsulated within other page element tags?
SAQ
5: What page element tag is recommended as a replacement for what two tags
in HTML 4.0?
2. HTML
FOR TABLES (
See
Niederst,
Chap. 10.):
-
Obviously, the table feature
of HTML was designed to allow the tabulation of information in a two
dimesional format; however, it has also become useful for:
-
controlling text alignment,
e.g. as done in the NAVIGATION PANEL of these LMs.
-
formatting pages so that
they will not be distorted when displayed by a browser; again, this exemplified
by the NAVIGATION PANEL. However one must remember this contradicts
an inherent feature of Web documents, that the page format is governed,
primarily, by the client. Also, the HTML 4.0 specification discourages
the use of tables for page layout, preferring the use of Cascading
Style Sheets with absolute positioning.
-
encapsulating features,
e.g. adding titles, citations, and other descriptions to ________(11).
This application of tables is used throughout the LMs of this course.
-
presenting multipart images
in a two-dimensional grid where specific section can contain animations,
rollovers, etc. (See
Niederst, pp. 201-205.)
-
preserve white space.
-
The HTML 4.0 Specification
for tables is much more sophisticated than the current specification.
It is designed to "bring context and structure to table data as well as
to provide systems for incremental display and display on non-visual display
agents (such as speech- and Braille-based browsers)."
-
Tables are easily created using
WYSISYG
autoring tools by selecting table creation from a menu and filling
in the properties of pop-up dialog box. The complexity of a table
depends on the sophistication of the authoring tool; FrontPage and Dreamweaver
can be used to design very complex tables without resorting to any HTML
coding.
-
The essential building
block of HTML tables is the <table> tag which must enclose
all other table tags, for example:
-
Rows are
created with the <tr> tag.
-
Cells are
created with the <td> (table data) tags which
must be enclosed within the row tags.
-
Groups of adjacent
rows can be defined using the tags: <thead>, <tbody>
and <tfoot>.
-
Groups of adjacent
columns can be defined using the <colgroup> tag.
-
The standard guideline for Web
development, KIS, also applies to tables, which in this case is
to avoid complex tables and try to design table structures
intuitively.
-
Niederst,
Chap. 10 contains numerous tips,
tricks, and trouble-shooting advice for tables.
-
The following table relates and
describes the standard tags/attributes associated with table layout.
SAQ
6: What current use of tables is discouraged in HTML 4.0 where style sheets
are preferred?
TABLE TAGS
|
TAG
|
ATTRIBUTES
|
DESCRIPTION
|
<table>
...</table> |
align=left|center|right
rules=all|cols|groups|none|rows
frame=void|above|below|lhs|rhs|
hsides|vsides|box|border
height=number, percentage
width=number, percentage
hspace=number
vspace=number
border=number
cellpadding=number
cellspacing=number
background=url
bgcolor="#rrggbb"
or color name
summary=text |
delimits a table |
<td>
...</td> |
align=left|center|right
valign=top|middle|botton|baseline
colspan=number
rowspan=number
char=character
charoff=length
(As above: background,bgcolor,height,width) |
delimits a data _____(12)
can include any content, including another table |
<tr>
..</tr> |
(As above: align,bgcolor,valigh) |
delimits a _____(13) of cells within a table |
<th>
...</th> |
(Identical to that for
<td>) |
delimits a header cell; typically used as column
labels |
<caption>
..</caption> |
align=left|center|right|top|bottom
valigh=top|bottom
(As above: summary) |
delimits a unique table label, typically a title |
<thead>
...</thead> |
(Identical to that for
<td>) |
delimits a table header cell, uniquely displayed by browsers
not implemented in Netscape
Navigator |
<tbody>
...</tbody> |
(As above: align,char,charoff,valign) |
delimits a set of _____(14) that form the body
of a table
not implemented in Netscape
Navigator |
<tfoot>
...</tfoot> |
(As above: align,char,charoff,valign) |
delimits the end of a table where the table properties
can be described
not implemented in Netscape
Navigator |
| <col> |
align=left|center|right
span=number
valigh=top|middle|bottom|baseline
width=number, percentage, n*
(As above: char and
charoff) |
specifies the characteristics of column/columns
not implemented in Netscape
Navigator |
<colgroup>
..</colgroup> |
(Identical to that for
<col>) |
delimits a set of columns that can be treated as a group
not implemented in Netscape
Navigator |
SAQ
7: Which of the table tags can be encapsulated within <table>
and </table>?
SAQ
8: What is the difference between <thead> and <th>?
3. HTML
FOR FRAMES (
See
Niederst,
Chap.11 .):
-
Frames are
composite tag structures that allow a Web page to be divided into multiple
active, scrollable windows and governs what appears in each of these
window. To accomplish, this the <body>...</body>
tag pair of a normal Web page is replaced with a <frameset>...</frameset>
tag pair which encapsulate <frame>...</frame>
tag pairs for each frame and the information necessary to construct and
control the frames.
-
The code of each
HTML frame defines the URL of the _____(15)
to be displayed a
particular frame window as well as the tag attributes that govern that
display.
-
A particular frame
can be identified as the "target" of a hyperlink, where the download
file should be displayed. By default, a linked document loads into
the same frame as the link. However, the hyperlink that generates
the display may be in a different frame; this is accomplished by using
the name attribute to identify a frame and then using the
_____(16)
attribute in the frame where the hyperlink is. (See the simple HTML
source of the two-frame pages of this learning module.)
-
Frames are controversial.
-
Advantages:
-
Frames allow the
display of different Web pages in a collage of mutually exclusive, independent
windows.
-
The independence
of frames means one frame can scroll or update while the others remain
stationary.
-
Disadvantages
(Others mentioned in the text are easily overcome.):
-
Currently there
is no way to track the states of a frameset, so the history of a
sequence of pages is inaccessable.
-
The nonlinearity
of frames means search engines are less effective. Pages may
be overlooked by search engines or may be displayed out of context of their
frameset.
-
Frames may be
nested, but this adds to the complexity of the page structure and complicates
the job of search engines, so there should be a good reason for doing this.
-
A good way to investigate
various frame layouts and their associated HTML is to investigate the framed
page templates in Microsoft FrontPage. (Simply select New|Page
from the File menu and click the Frames Pages tab.
-
Microsoft implements
"floating frames" with a proprietary <iframe>
tag; these can only be displayed in Internet Explorer. This inline framing
technique allows other HTML documents to be embedded within a host
HTML document. The <iframe>...</iframe> tag
pair must be inserted within the body of the HTML document. Microsoft
suggests that the topmargin and leftmargin
attributes of the <body> tag should be used to locate
the frame in the browser window.
-
Frame borders
are shared and border colour conflicts are automatically resolved by
the browser; however, the priorities can be overridden by the HTML author.
-
Note that there
is currently no CSS equivalent to frames.
-
Niederst,
Chap. 11 contains numerous tips,
tricks, and trouble-shooting advice for frames in pages 220+.
-
The following table relates and
describes the standard tags/attributes associated with frame layout.
SAQ
9: What is the primary difference between the HTML of a normal page and
a page with frames?
FRAME TAGS
|
TAG
|
ATTRIBUTES
|
DESCRIPTION
|
| <frame> |
bordercolor="#rrggbb" or color name
frameborder=1|0
src=url (URL
of initial file to be displayed)
target=text
(frame in which linked pages are displayed)
longdesc=url
marginwidth=number
marginheight=number
name=text
noresize
scrolling=yes|no|auto |
defines a single frame within a <frameset> |
<frameset>..
</frameset> |
cols=list
rows=list
border=number
framespacing=number |
defines the format of a set of frames or framesets |
<iframe>...
</iframe> |
align=left|center|right|top|bottom
(As above: frameborder,height,width,
marginheight,marginwidth,hspace,vspace,
name,noresize,scr,scrolling) |
defines a floating, _____(17) frame similar to
<img> |
<noframe>...
</noframe> |
|
specifies content displayed by browser that do not handle
frames |
SAQ
10: What frame tags are used in the Web page you are viewing?
4.
FORMS (
See
Niederst,
Chap.12 .):
-
HTML forms are
formatted text containing buttons, checkboxes, blank fields, etc. that
are used to interactively enter data.
-
In Web
pages, information is typically entered via dialog boxes, pop-up
windows whose size, location, and appearance is specified in HTML.
Dialog
boxes usually provide visual components called controls, (e.g.push
buttons, radio buttons, check boxes, list boxes, multiline edit controls,
etc.) which allow the user to interact with the Web server in a limited
way.
-
Normally
forms are completed before the data is sent to the server. Sending
the composite data is initiated by clicking a submit button, a special
button defined by adding submit
as the type of the <input...>
tag. HTML does not support server-side
monitoring of user manipulation of individual controls within a form or
server-side enabling/ disabling of individual controls on a form after
the form has been shipped to the client browser.
See the
simple example of a basic HTML form in Niederst,
Figure 12-1
-
Forms, when
combined with scripts (miniprograms written in JavaScript, CGI, VBScript,
etc.), facilitate interaction between the user and a Web site.
On their own, forms are of limited use, but, when augmented, for example,
with JavaScript or CGI scripts, (See LM
I, section 4.2.) they allow the user to input
data, have it processed on the server, and, if desired, have information
returned to the user or forwarded to others.
-
The
data supplied to the client-side JavaScript script or server-side CGI program
should be supplied withing the <form>
tag.
-
When
the user clicks the submit button, the data is passed to the particular
script or CGI program specified by the action
attribute.
-
HTML
tags for controls do not include any positioning information. The
controls are displayed in the Web browser's window in the order that they
appear in the HTML source. So far, no WYSIWYG HTML authoring tools exist
for designing of HTML forms visually on personal computers. Until
these arrive, the following techniques can be used to control the spatial
orientation of forms:
-
The
vertical spacing between controls can be set with <br> (____
______(18)) and <p> (________(19))
tags.
-
Controls
can be grouped together using the <hr>
(_________ ____(20)) tags or
in-line graphics.
-
Tables
can be used to precisely define the location of controls, e.g. labels
and the associated controls can be aligned as rows in a two column table.
Unfortunatly,
in general, the ability to construct HTML forms that efficiently use
the page area and interactively respond to the user is still severely limited
in the current versions of HTML. Of course, alternative versions
of a form can be downloaded to a browser depending on what is known about
the user's previous choices.
-
The
primary building blocks of HTML forms are the five tags:
<form>,
<input>,
<textarea>, <select>, and <option>.
These tags, along with their attributes, are used to code all the possible
controls and designate the particular server side program or script that
will process the form's data.
-
The <form>
tag:
-
All form-related
tags must be encapsulated within <form>and
</form>.
-
Any other
standard HTML elements (formatted text, headings, lists, tables, etc.)
can be encapsulated within the <form>
and </form> tags.
-
The <form>
tag has three possible attributes:
-
The action
attribute's value is the URL of the server-side program or script
that is designated to process the data entered the form.
-
The method
attribute has two possible value, get or post,
which defines how the data will be passed to the ____________(21)
program or script.
-
The enctype
attribute is reserved for encrypted transactions.
-
When
the a button of type submit is
clicked, the data from all the controls in the form are sent as a series
of controlname=controldatapairs
to
the program or script specified in the action
attribute of the enclosing <form>
tag. The exact manner in which the data is presented to the program or
script depends on the method
attribute of the <form>
tag.
-
It is
possible to create multiple forms on a single Web page, but this is discouraged.
Separate
pages for separate forms is recommended.
-
The <input>
tag is a multipurpose tag for creating clickable buttons, check
boxes, and text-entry boxes. It has ten possible attributes specified
in the following table, INPUT
TYPES FOR FORM TAGS.
-
The tree
most important attributes are:
-
name
which associates a unique developer-defined symbol with the control (This
identifies particular data when it is sent to the server.),
-
type
which can take on the values specified under the TYPE column in the table,
INPUT
TYPES FOR FORM TAGS, and
-
value which allows
the programmer to define a default value for the control.
-
Any user-oriented
label for the text-entry box occurs outside the <input>
tag, using ordinary HTML text coding procedures.
-
The tag
pair, <textarea>
and </textarea>is used to
create a multiline text-entry box. It can also delimit the default
text to appear within the box.
-
The tag
pair, <select>...</select>
is used to build menus or a list of choices.
-
The tag
pair, <option>...</option>
supplies the text for the individual elements of <select>
menus.
-
Unfortunately
the display of forms may vary between browsers, therefore
developing forms that function effectively in all browsers requires experimentation.
-
The Class
Message Board in the Navigation Panel is a nice, simple example of
the use of forms with interactivity provided by
JavaScript. Access the board, click Post
Now!, and then, right click in the frame and select View Frame Source
from the pop-up dialog box.
SAQ
11: What is the primary use of forms?
FORM
TAGS
|
TAG
|
ATTRIBUTES
|
DESCRIPTION
|
<form>...
</form> |
action=url (URL
of application that processes form data.)
enctype=encoding
method=get|post |
delimits a multielement form |
| <input...> |
See the following table, INPUT
TYPES FOR FORM TAGS. |
accepts user input in various, predefined ways |
<button>...
</button> |
name=text
value=text
type=submit|reset|button |
a more versatile button
than the <input> tag.
can contain text or images |
<textarea>..
</textarea> |
name=text
wrap=off|virtual|physical
cols=number
rows=number |
desplays a multiline text-entry field for user
input
Enclosed text will be displayed initially. |
<select>...
</select> |
name=text (defines
values that can be submitted)
size=number
multiple (allows user to
select multiple options |
a container for multiple <option>
tags.
useful for _____________(22)
questions or scrolling lists |
<option>...
</option> |
selected (specifies
that is initially selected)
value=text (returns
text
instead of <option> contents) |
defines an option within <select>...</select> |
<label>...
</label> |
for=text |
creates a label that can be associated with the
id attribute of a control
not implemented in Netscape
Navigator |
<optgroup>..
</optgroup> |
label=text (names
the option group (required) |
delimits a logical set of <option>
tags
not implemented in Netscape
Navigator |
<fieldset>..
</fieldset> |
|
groups related controls and labels
(similar to the ______(23) tag)
not implemented in Netscape
Navigator |
<legend>...
</legend> |
|
assigns a name to a <fieldset>
not implemented in Netscape
Navigator |
-
The <input> tag currently
has _____(24) possible types, depending on the value specified for
type
in the syntax <input type=type>.
The possible types are specified in the following table.
-
A nice pictorial illustration of the
appearance
of these types is given in Niederst, Table
12-2, pp 243. (Although the browsers depected are not the
latest, the illustration effectively depicts the differences in the
input types.)
INPUT
TYPES FOR FORM TAGS
(In the HTML, the following
types replace type in the tag <input type=type>
|
TYPE
|
ATTRIBUTES
|
DESCRIPTION
|
| text |
name=text(specifies
name of parameter used for processing)
value=text(value
passed to form processing application)
size=number (size
of text entry field)
maxlength=number (maximum
acceptable text) |
default type; permits text submission to server-side
form processing application
creates a text input field, the most useful type
of input |
| file |
name=text (specifies
name of control)
value=text (value
passed to form processing application)
accept=MIME type (filter
for files that can be processed) |
permits an external file submission
When displayed a browse window is opened. |
| password |
(Identical to that for
text) |
permits password submission withoug displaying
the password |
| hidden |
(name, value as
for text) |
permits data submission without displaying it
in the browser |
| button |
(name, value as
for text) |
creates customizable button; often used to
trigger JavaScript functions. |
| radio |
(name, value as
for text)
checked (specifies
button is initially "on") |
creates mutually exclusive on/off buttons |
| checkbox |
(name, value as
for text)
checked (specifies box
is initially checked) |
creates checkboxes; allows multiple selections |
| submit |
(value as
for text) |
creates button that submits completed form for
processing |
| image |
(name, value as
for text)
align=top|middle|bottom |
same as submit except an image can be used
instead of a button |
| reset |
(value as
for text) |
creates button that resets form fields to default
values |
SAQ
12 : What is the functional difference between a radio button and checkbox?
5. SERVER-SIDE
INCLUDES (SSI) (
See
Niederst,
Chap. 13.):
-
A SSI (server-side
include) is
a statement returning a variable value that a Web server
inserts into a specified location in an HTML file before it is downloaded
to a browser. The syntax of an SSI statement is:
<!--#element
attribute="value" -->
where the SSI element
is a function available on the server that returns an output derived from
the value of its attribute, e.g.
<!--#echo
var="DATE_GMT" -->
will tell the server
to insert the current date in Greenwich Mean Time. DATE_GMT is an
example of a standard UNIX environment variable whose value is maintained
by the operating system so that it can be used by a server program.
Such variable provide the distinct advantage of curreny.
-
Obviously, the
characteristics of the SSI inherently depend on the particular _________(25)
of the Web server
-
When an HTTP request
is received, the server parses the specified HTML file and executes
the SSI statements, including their output at the statement location.
(Parsing means to breaks a program into is basic instructions.)
-
Access to this
variables is obtained from the server administrator. A
Web page that contains SSI statements is often distinguished by the administrator
with a htmlf or shtml suffixes, but this is not necessary.
-
SSI
function like CGI scripts in that they are processed on the server
(rather than the client, like __________ and _________(26) normally
are) and are thus independent of the browser and O.S. of the client.
-
SSI
are simple to learn and implement; however, they are much
more limited than than the flexible CGI programs.
-
SSI
may be combined with CGI scripts to optimize the power of server-side
programming.
-
XSSI
(eXtended
SSI), available on Apache servers of Version 1.2 or higher, provide
-
a
more
extensive set of commands,
-
for
the definition of new variables, and
-
selection
control structures (if/else) enabling decisions to be made
by the XSSI instructions.
-
In
order to utilize SSI, one must ask the server administrator which
environment variables are available. The administrator needs
to configure the server to provide SSI.
SAQ
13 : What is the primary (a) similarity and (b) difference between SSI
and CGI?
LIST OF SSI
ELEMENTS
|
SSI
|
ATTRIBUTES
|
DESCRIPTION
|
| config |
errmsg (default
error message during parsing)
sizefmt
(sets format for displaying file size)
timefmt
(sets format for time and date) |
governs SSI I/O |
| echo |
var (contains
the name of the variable to print) |
displays/prints the value of the variable |
| exec |
cgi (executes
CGI script given by a relative URL)
cmd (executes
UNIX shell program) |
executes external application and outputs to the current
document |
| fsize |
file (give
relative path/name of file)
virtual
(gives relative URL of file) |
specifies path of file |
| flastmod |
(Identical to that for
fsize) |
specifies date of last modification |
| include |
(Identical to that for
fsize) |
inserts another file into a parsed file. |
| printenv |
|
lists all variables and their values |
| set |
var (specifies
variable to be assigned a value)
value (specifies
value to be assigned) |
assigns a value to a variable |
SSI VARIABLES
(USED BY SSI INSTRUCTION,
TYPICALLY THE ECHO COMMAND)
|
VARIABLE
|
DESCRIPTION
|
| DATE_GMT |
specifies the Greenwich Mean Time that is maintained
by the server. |
| DATE_LOCAL |
specifies the current date, local time |
| DOCUMENT_NAME |
specifies the name of the current file |
| DOCUMENT_URI |
specifies the URL of the current file |
| LAST_MODIFIED |
specifies the time and date of the last modification
of the current file |
| QUERY_STRING_UNESCAPED |
contains an undecoded query string, typically for accessing
a CGI script |
-
For a good SSI Tutorial (Linked from www.leoville.com,
Leo LaPort's site.) see http://www.useforesite.com/tut_ssi.shtml
NOTE:
you have now covered the material required to answer questions 16-29 on
PREASSESSMENT 120-2. Be sure to circle you answers now and go back
and study the content relevant to questions about which you are unsure!