#! /usr/local/bin/ehtml The Official EHTML Page - Code COOKIE

The Official EHTML Page - Code COOKIE

To Display Random Lines In Your Page


The <COOKIE> code under EHTML is used to display a single random line of a plain text file in your EHTML page. This line can contain random quotes from telivision series, plugs for a company's products, or even links to other pages.

For the context of the <COOKIE> code, a plain text file is a file that may contain HTML codes, but not EHTML codes. If you wish to place line breaks in a cookie, you should use the standard HTML <BR> code.


Attributes

filename
The name of the plain text file, as it exists under UNIX, without the ".cookie" postfix, that you wish to display a line from within your EHTML page. This file must exist in your "html/ehtml" directory and have it's permissions set to be "readable by the world".


Setup

Since the <COOKIE> code is responsible for displaying a line from a plain text file to the screen, that text file must exist. As well, the text file must be "readable by the world". This is done by setting the appropriate "file permissions" under UNIX.

To begin the setup for the <COOKIE > code, you must access a UNIX prompt by either logging in to "alpha.vaxxine.com" using a terminal emulator program or by using a " telnet" program running over SLIP/PPP.

After logging in, you must enter your "html/ehtml" directory and create a file containing the lines that you wish to display randomly. If you are not familiar with the use of the "pico" editor, which will be referenced below, you may enter Ctrl-G while within the editor to Get help.

To create a cookie file called "ehd_default.cookie" which could be used with the <COOKIE> code, you would enter the following commands at the UNIX prompt. You do not need to type anything after the semicolons (;) as they are just comments.

cd ~/html/ehtml          ; # Enter your "html/ehtml" directory under UNIX
chmod a+rx .             ; # This lets other people read message files
pico ehd_default.cookie  ; # Enter cookies, one per line
chmod a+rx *.cookie      ; # Other people can read cookies in particular

After your cookie file was created in the way specified above, you must add the code to your document in order to display a cookie. In this example, you would use the standard basic code style of <COOKIE ehd_default> . Note that "ehd_default" must be in all lower case since that is the way we named the "ehd_default.cookie" file under UNIX.

The "ehd_default.cookie" File: