This document is used to test and demonstrate an installation of Art Sackett's redirect.pl (redirect.cgi) Perl script for CGI browser redirection. This page may be used to test your own installation, as it is included in the archive distribution -- you will first have to edit the paths within the anchors to accomodate your installation. If you are not viewing the version that is online at http://www.artsackett.com/freebies/redirect/redirect.html and have not edited the HTML of this document, tests may fail -- and you may be looking at an outdated version. This document applies to Version 0.9, the first public release.
redirect.pl in it's simplest installation does nothing more than handle the output of an HTML form that contains a list of several destination URL's by telling the visitor's browser that it should retrieve the user-selected URL. Either the GET or POST method may be used. The script will refuse to cooperate if it detects that it is not being called from a document that originated on the server it is installed on. This prevents, as much as possible, others from stealing your server resources. This function can be overridden on a case-by-case basis, but cannot readily be disabled except by serious misconfiguration of optional functionality.
redirect.pl can also be used to create the form element within the HTML document, if the hosting server supports Server Side Includes ("SSI"). redirect.pl can generate the HTML on the fly using an external list of option value pairs consisting of the URLs to be retrieved and the corresponding text to be displayed in the popup menu.
A representative sample of the modes of operation available is presented below.
This form uses the GET method. The HTML markup for the form element was written into the HTML of this document. This form is presented within a table for a nicer appearance.
| Please choose a destination: | |
This form uses the POST method (but could have just as easily used the GET method). The HTML markup for the form element was generated dynamically by the action of redirect.pl which was called from an SSI directive in the markup of this page. The same script both generates the form and processes it when it's used. Because the script only generates the minimum necessary HTML, you can include it's output in your own markup to get the look you want.
The SSI directive that caused the inclusion of the above form is:
<!--#include virtual="/cgi-bin/redirect.cgi?method=post&extlist=list.txt" -->
There are several options available for controlling the HTML generated by redirect.pl. By changing the arguments passed to it in the SSI directive, you can control:
Here is what the form element looks like with all of the options defined to their non-default states:
The SSI directive that caused the inclusion of the above form is:
<!--#include virtual="/cgi-bin/redirect.cgi?method=post&text=bolditalic&label= This is an UGLY Button! &button=left&extlist=list.txt" -->
Each of the above forms is fully functional on the artsackett.com web site. To alter this page for use on your site, you will have to ensure that SSI is possible and configured to parse this document, and you may have to edit the path within the SSI directives to match the installation of redirect.pl on your site. (In the download version of the package that contains this document, the path is set to cgi-bin/redirect.cgi and the script is named redirect.cgi to get past the common problem many people have with servers that will not consider any.pl a CGI application.) (The included via SSI portions of this page will not appear if you are viewing this page without it having been served to you by a properly configured HTTP server, and the form(s) will not function if there is no redirect.pl installed on a properly configured server at the URL indicated in the HTML forms.) A brief introduction to Server Side Includes, SSI for the Rest of Us is available in the grey papers that can be accessed using the form(s) above. Please do not contact artsackett.com with questions regarding SSI unless and until you have followed the instructions for installing this script painstakingly and have read SSI for the Rest of Us and just as painstakingly followed the instructions there. This is, after all, a free script that comes with no guarantee.
| Index/Intro [on/offline] |
HOWTO [on/offline] |
grey papers [online only] |
Art Sackett Professional Web Design [online only] |