netConsole: Fortune Cookie
The Fortune Cookie is a neat little element that adds some fun to any webpage. When a page containing the Fortune Cookie is accessed, a random string of text is generated.
Setting up Fortune Cookie
The Fortune Cookie is a CGI script that relies on Server Side Includes (SSI) to operate. In order for your webpage to be capable of running a CGI script such as this, you must rename your .html or .htm file to use the file-extensions .shtml, .shtm or .sht. For example, index.html should be renamed index.shtml. Don't forget to re-adjust your links after making this change.
On the page you'd like the Fortune Cookie to appear on, add the following code:
<!--#exec cgi="cgi-bin/fortune" -->
The Fortune Cookie can be placed be placed between words or HTML tags:
Today's Pearl of Wisdom: <br>
<i> <!--#exec cgi="cgi-bin/fortune" --> <i>
Things to Remember
Remember to name the HTML files correctly for CGI compatibility (i.e. .html -> .shtml).
Should the Fortune Cookie fail to work properly, we recommend that you delete and re-install it from the control panel.
- IC Tech. Ref. Document: Using the Common Gateway Interface
- IC Tech. Ref. Document: Server Side Includes (SSI)
- Free On-line Dictionary of Computing's definition of the Common Gateway Interface
- Free On-line Dictionary of Computing's definition of the Server Side Includes
- NCSA's The Common Gateway Interface
- NCSA's Introduction to CGI
- NCSA's SSI Tutorial
- Plenty of SSI Documentation courtesy of The CGI Resource