Click Here!
home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Perl CGl Programming: No experience required.
(Publisher: Sybex, Inc.)
Author(s): Erik Strom
ISBN: 0782121578
Publication Date: 11/01/97

Bookmark It

Search this book:
 
Previous Table of Contents Next


Table 8.3 lists the available format codes for #config timefmt.

Table 8.3: Formats for Displaying Dates and Times with SSI

Format Means Example

A Day of the week Friday
%a Abbreviated day of the week Fri
%B Month name September
%b Abbreviated month name Sep
%D Date in MM/DD/YY format 09/11/97
%d Two-digit date 09
%e One-digit date 9
%H 24-hour time 15
%I 12-hour time 03
%j Day of the year, as a number 125
%M Minutes 10
%m Numeric month 09
%p AM or PM PM
%r Time in HH:MM:SS XM format 06:15:12 PM
%S Seconds 06
%T 24-hour time in HH:MM:SS format 18:15:12
%U and %W Week of the year 10
%w Numeric day of the week 6
%Y Year 1997
%y Two-digit year 97
%Z Time zone EST

A Last Word on SSI

As you have seen, the server-side includes extend the utility of HTML by allowing you to place instructions to the Web server directly in the document that makes up a Web page. SSI can add a great deal of power to your Web site.

Even if your Web server doesn’t have SSI capabilities included in it, the chances are quite good that a later release will—probably very soon. It’s well worth your trouble to get to know SSI.

Generating Graphics on the Fly

HTML generally knows what to do with graphical images in the proper formats, but it expects the graphics to be passed to it in the form of files, either in GIF or JPEG format. This ability necessarily means that the graphics have to be in a file, pregenerated and hard-coded into the URL that the Web page will call up, as in:

   <IMG SRC="graphic.jpg">

Within this context, generating dynamic information graphically would seem to be a bit of a problem. If the only way the Web page can display a graphical image is by calling up a file, how do you change the file based on the visitor’s input? In other words, how can you generate graphical images that base themselves on what the visitor has entered into the Web page or on any other criterion that hangs explicitly on this individual visitor?

Well, first of all, HTML isn’t limited exclusively to files as a medium of input for displaying graphics. Second of all, there’s Ghostscript.

Creating Graphics with Ghostscript

PostScript is another programming language, this one invented by Adobe Systems in the mid-1980s as a page description language—a way to format pages of graphical text so they could be sent to a printer or typesetter and printed in the way they were set up on the computer screen. From this convention sprang the acronym WYSIWYG (pronounced “wiz-ee-wig”), for “What You See Is What You Get,” meaning that what you set up on the computer screen would be what gets spit out of the printer or typesetter. Adobe Illustrator and Pagemaker, both hugely popular programs for more than a decade, utilized this technology from the beginning. Now most commercial publishing is done with PostScript.

Of course, Adobe owns PostScript and will require a large sum of money from anyone who would use it. Luckily, however, there’s the Free Software Foundation and its cleverly named freeware PostScript clone: Ghostscript.

FSF, flying the banner “GNU’s Not UNIX!,” started its GNU Project in 1984, primarily to develop and distribute a free version of the UNIX operating system, source code and all. Since then, the foundation has trolled into waters heretofore patrolled exclusively by Bill Gates and his jolly brigands—a CD-ROM full of source code for Windows NT goodies was shipped by the GNU folks within months of NT’s initial release.


NOTE:  The Free Software Foundation’s Web site at http://www.gnu.org is worth a visit if only for exposure to the foundation’s unorthodox views about profiting from software. FSF adheres to a “strictly-free” policy, a kind of software socialism that must make the corporate marketing types quake in their boots when they think about its ramifications. In addition, you’ll find links to a veritable cornucopia of free goodies at the GNU site. Be advised, however, that the GNU Project’s repertory tilts decidedly toward UNIX. A lot of the free software you’ll find there requires the knowledge and experience of a seasoned UNIX wrangler to use it effectively.

Ghostscript is a program that interprets PostScript code into a variety of formats, including at least one—JPEG—that you can use on your Web site. PostScript code, like Perl, consists of text statements that describe the desired actions to the interpreter. Unlike Perl, PostScript deals mainly with graphics and formatted text.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited.