The intphone CGI script

Overview

The intphone CGI script is a Euphoria based CGI program for web servers on Linux.

It was developed on a RedHat 5.1 system with Apache version 1.3.19 but you may have success running in similar environments.

Setup

Copy the following files to the cgi-bin directory:

    eucgi.e
    intphone
    intphone.exu
    phone.txt

The filenames must all be in lowercase.

The eucgi.e, intphone.exu and phone.txt files should have the following mode:

    -rw-r--r--

The intphone file should have the following mode:

    -rwxr-xr-x

Edit the phone.txt file to contain relevant names and numbers. It is a simple colon (:) delimited file. Lines beginning with a hash (#) character are comments. Other lines should be colon delimited as follows:

    Field 1 - First name
    Field 2 - Second name
    Field 3 - Office number
    Field 4 - Office extension
    Field 5 - Mobile and/or other number(s)

For example:

    Fred:Bloggs:0123 456 789:4321:777 666 555

Fred Bloggs has an office number of 0123 456 789, an extension of 4321 and an altenative number of 777 666 555.

Once phone.txt has been edited run the CGI script from a browser. On my RedHat system I enter the following URL:

    http://10.1.1.2/cgi-bin/intphone

Type a search string (e.g. "fred") and observe the results.

Uses

The intphone CGI script is a nice example of how useful an online phone book can be and how easy it is to set up with open source software like Apache.

However it's main use is to demonstrate using Euphoria as a CGI scripting language.

The useful functions reside in the eucgi.e include file so they can be easily reused by other scripts.

Study the code for exact implementation details.

License

The intphone CGI script (and any supporting include files, shell scripts and documentation) is public domain. Use, reuse, modify, distribute and even sell it if you can.


Document prepared by Andy Cranston on 24th June 2002.