Notice! This document is currently in Archived status.
The content of this document may be incorrect or out dated.

Using ECN Wraps with a cgi script

If you have a cgi-script written in PERL you may use the ECN Wraps. To use them add the following to your script:

use lib '/usr/local/etc/httpd/DocumentRoot/ECN/ecnweb'; use ECN::Wrap;

Then where you would normally print the head and foot of the html document, simply call the functions wrap_top and wrap_bottom, respectively.

For Example:

#!/usr/bin/perl -w # example.cgi # This is a program to show how the # ECN Wraps are used with PERL use lib '/usr/local/etc/httpd/DocumentRoot/ECN/ecnweb'; use ECN::Wrap; #print the html header print "Content-type: text/html\n\n"; #Call the wrap_top function to add the ECN header. &wrap_top; #Body of the page goes here! print "<h1>Hello World!</h1>"; print "<a href=\"$ENV{'HTTP_REFERER'}\">Back to the FAQ page.</a>"; #Call the wrap_bottom function to add the ECN footer. &wrap_bottom; exit;

You will also need a .htaccess file with the following lines.

SetEnv WrapTop /ECN/ecnweb/Includes/top.cgi SetEnv WrapBottom /ECN/ecnweb/Includes/bottom.cgi

Here is an example .htaccess file:

Options All MultiViews SetEnv Owner "Purdue University" SetEnv Organization "Engineering Computer Network" SetEnv WrapTop /ECN/ecnweb/Includes/top.cgi SetEnv WrapBottom /ECN/ecnweb/Includes/bottom.cgi SetEnv Home /ECN/ecnweb/ SetEnv DirectoryName "Engineering Computer Network"

To see this example in action click Here

Last modified: 2007/06/21 12:54:11.673000 GMT-4 by Unknown
Created: 2007/06/21 12:54:11.673000 GMT-4 by brian.r.brinegar.1.

Categories

Search

Type in a few keywords describing what information you are looking for in the text box below.

Admin Options: Edit this Document