Mercyhurst University logo
Random department photos

Mercyhurst University Links:

Web Page Help 1.2

Local Users Web Page Help
The <a>...</a> Tag ... The Backbone of WebPages
Blue horizontal rule image
<a href="filename"> </a>
This is the tag in HTML that creates a hyperlink to another Web page.
There are four general types of links distinguished by the location of the file you are linking to:

  1. Specifying a URL for a file in the same directory:
    <a href="filename.html">Text you want user to see</a>
    The previous code produces a link that appears as:    Text you want user to see
  2. Specifying a URL for a file in a subdirectory:
    <a href="subdir/filename.html">Text you want user to see</a>
  3. Specifying a URL elsewhere on the same server: (Note beginning slash)
    <a href="/people/activities/index.php">Outdoor Activities</a>
    The previous code produces a link that appears as:    Outdoor Activities
  4. Specifying a URL for a file on another web server:
    <a href="http://www.theregister.co.uk/2002/05/19/ms_in_peruvian_opensource_nightmare/"> M$ in Peruvian open-source nightmare</a>
    The previous code produces a link that appears as:    M$ in Peruvian open-source nightmare from The Register.

Other uses of the <a>...</a> tag

  1. Creation of an email link:
    Please <a href="mailto:jarek@math.montana.edu_NOSPAM">email me</a> with your math questions.

  2. The previous code produces a link that appears as:    Please email me with your math questions.
  3. The a href tag is also used to link to postscript and pdf files:
    PDF version of <a href="/~griff/courses/m240/Review/laplace.pdf">Laplace Transforms</a>
    The previous code produces a link that appears as:   PDF version of Laplace Transforms
  4. The NAME attribute is used to specify links within a page.
    The links look like: <a href="#bottom">Bottom of the page</a>
    The previous code produces a link that appears as:    Bottom of the page
    You must specify where you want the browser to land with either an id attribute/value pair ( id="bottom") or a NAME anchor ( <a name="bottom"> ).
    OR another use: <a href="web_2.php#top">Return to Top of the page</a>
    The previous code produces a link that appears as:    Return to Top of the page
    Note, unlike other attributes, NAME is case-sensitive.
  5. The Target attribute is mostly annoying. but occasionally there is a use like:
    <a href="/local/help/images/isaac.jpg" TARGET="NewWindow">Isaac</a> at a recent conference
    The previous code produces a link that appears as:    Isaac at a recent conference

Server Side Includes
Blue horizontal rule image

Server Side Includes (SSI) provide a simple way to embed dynamic content into a web page. The main advantage of SSI over other embedding techniques is the simplicity of learning and using SSI.

A partial list of what is possible using SSI:

SSI provide a simple means for simple tasks, and is not intended for complicated programming tasks. Once the directive is processed (and no errors occur) the appropriate text is added to the web page and NO trace of the SSI code remains.

Requirements

  1. SSI must be 'allowed' in the directory. This is setup in the apache configuration file.
  2. You must tell the server to parse the document for SSI. Also, setup in the apache configuration file.
    This is most easily done by using the extension .shtml.
    Our server has the XBitHack turned off.
  3. Exact syntax followed - see below
Blue horizontal rule image

SSI Tutorial

HTML uses the names <tag attribute="argument"> whereas
SSI uses <!--#directive argument="value"--> .

No spaces are allowed between the opening delimiter <!-- and the start of the command. Similarly, between the end of the command and -->, no spaces are allowed. And yes, this should look a lot like an HTML comment.
The result should look like this:
<!--#configfile="filename.html"-->. Failure to follow this simple rule will result in the server seeing a <!-- comment --> instead of what you intended.

Example:
We wish to include time of last modified information, first we configure the output as:
<!--#config timefmt="%D" -->
This is the time & date command: <!--#echo var="DATE_LOCAL"-->
Today is:
or using: <!--#config timefmt="%d %b %y"--> on <!--#echo var="LAST_MODIFIED"--> :
Last Modified: A Final comment: When the page loads, the directives are executed, and assuming no errors are encountered, what appears when you view the source is the execution of the SSI not the actual directive.

Some References

Blue horizontal rule image

CONFIG TIMEFMT

This table shows all the options which can be used with the config timefmt directive

option description e.g.
(hard-coded)
e.g.
(using DATE_LOCAL)
DAY
%aabbreviated weekdayTueSun
%AweekdayTuesdaySunday
%dday of month (01-31)0404
%eday of month (1-31) 4 4
%wday of week (0-6, Sunday=0)20
%jday of year (001 to 366)186247
WEEK (week 1 starts on first Sunday of year)
%U or %Wweek number (00 to 53)2736
MONTH
%babbreviated monthJulSep
%Bfull monthJulySeptember
%mmonth (01 to 12)0709
YEAR
%ytwo-digit year0005
%Yyear20002005
DATE
%cstandard date and time07/04/00 12:03:21Sun Sep 4 17:08:23 2005
%xstandard date07/04/0009/04/05
%DMM/DD/YY date07/04/0009/04/05
TIME
%Xstandard time12:03:2117:08:23
%rstandard time in local notation12:03:21 PM05:08:23 PM
%Tstandard time (24 hr clock)12:03:2117:08:23
%Hhour (00 to 23)1217
%Ihour (01 to 12)1205
%Mminute (00 to 59)0308
%Sseconds (00 to 59)2123
%pAM or PMPMPM
%Z or %ztime zoneGMT Daylight TimeBST
LAYOUT
%nnew line

Blue horizontal rule image
Our local Tutorials:
| Basic HTML | More Advanced HTML | Return to Top of the page |
Blue horizontal rule image
1164
Last modified: 13 Aug 09
Get Firefox! W3C CSS Validation Service Valid XHTML 1.0 Transitional