indiWiz.com
SiteSearch:
Jump:

Site Map | WizTools.org | jCraze Blog
Web Developer's Den!
Home : WDD : ServerSide
This Article...
Print Version
Add Comment
View Comments
ServerSide
Apache on Linux
Apache User Directory Configuration
PostgreSQL Configuration
CGI: What and How?
PHP Jump Start Guide
Arrays in PHP
PHP and HTML Forms
Variable Passing in PHP
PHP 'include'
Drop-down Menu Navigation in PHP
Edit Your Site Online Using PHP
PHP MySQL Polling System
Dynamic, Search Engine Friendly Pages
Quot Ticker Using SSI
Regular Expressions Reference
PHP File Browser
PHP DB Deletion/Approval Script
Sections

Commniquè
Sign Guestbook!
Read Guestbook!
MailMe!

Subhash's Guide to Creating a Quote Ticker

Pre-requisite

The quote ticker will be made & hosted using the following tools:
  1. Linux
  2. Apache server with Server Side Includes enabled
  3. Fortune - this is the program that selects a random quote & sends it to the standard output.
If you do not have any of these, do not panic. There are alternatives ...

Fortune

First I will introduce you to this wonderful program. I run RedHat Linux 7.1. This software is installed by default in:
/usr/games/fortune
What this app does is take random quotes from text files located at:
/usr/share/games/fortunes/
& displays them at the terminal. You also have the power to create custom quote files. The files are neatly classified as 'love', 'poetry', etc. Suppose you want only quotes from the file 'love', you will have to use the '-e' operator:
#fortune -e love
Every time you want to know what are the subjects on which quotes are available you need not change directory. You can use the '-f' operator:
#fortune -f
For more options read the info & man pages of this app.

SSI

Now we move on to making this app web enabled. We will be using Server Side Includes. The code for displaying the standard output of the executable 'fortune' is:
<!--#exec cmd="/usr/games/fortune" -->
You can also use command-line options:
<!--#exec cmd="/usr/games/fortune -e love" -->
And don't forget to save your file with the extension '*.shtml'. If server side includes is enabled, this should work. Full code is given below:

<HTML>
<HEAD>
</HEAD>
<BODY>
<H2 ALIGN=CENTER>Quot Ticker</H2>
<CENTER><!--#exec cmd="/usr/games/fortune -e love" --></CENTER>
</BODY>
</HTML>

The Alternative

Don't have a server in your command? Not to worry. The net is there to back you!!! I discovered the Goth Quote ticker in this web-site:
http://www.brunching.com/toys/toy-gothquotex.html
The code they gave me to paste in my page was(check for updates):

<A HREF="http://www.brunching.com/toys/toy-gothquotex.html"><IMG SRC="http://www.brunching.com/cgi/gothgif.cgi" BORDER=0 ALT="A Quote" WIDTH="275" HEIGHT="120"></A>

This looks thus:
A Quote

User Comments

Add Comment

[Quick Stats: Number of main threads: 0, Number of sub-threads: 0]

Sign Guestbook | Who is Subhash?
The contents of this site are copyright© 2000-2008, indiWiz.com. All Rights Reserved.