ALTS.NET Technical Support Virtual Private Server

ALTS.net Main Menu

Technical Support

Virtual Private Server
Virtual Private Server v2

Comments Form and CGI

A web site wouldn't be complete without some simple method of sending comments or requesting information. A small form and simple CGI can be designed to facilitate such a task.

Installation

To install the Comments CGI, do the following:

  1. Create A Comments Form - Create an HTML page where your visitors can go to fill out a form. The following is a sample segment of HTML that you could use for part of the page (feel free to copy and paste this segment into your HTML page).

    <h3>Send Comments / Request Information</h3>
    
    <p>Feel free to send us your comments, suggestions, and/or questions. We value your input and desire to make these 
    pages as useful as possible. Please leave an E-mail address so we can reply to you.</p>
    
    <p>If your web client supports the "mailto" URL, you can use your <a href="mailto:E-MAIL@YOUR-DOMAIN.NAME">local mail
    app</a> to compose and send a mail message. Otherwise, you can use the form below. For those using browsers that do not
    support forms such as this, send mail to: <i>E-MAIL@YOUR-DOMAIN.NAME</i>.</p>
    
    <form action="/cgi-bin/library/comments/comments.pl" method="post">
    <input type="hidden" value="E-MAIL@YOUR-DOMAIN.NAME" name="recipient">
    <p>Your Full Name:</p>
    <input size="50" name="name">
    <p>Your E-Mail address:<p>
    <input size="50" name="email">
    <The Subject of Your Message:>
    <input size="50" name="subject">
    <p>Your comments, suggestions, and/or questions:<p>
    <textarea name="comments" rows="8" wrap="physical" cols="50"></textarea>
    <input type="submit" value="Send Comments">
    <input type="reset" value="Clear Form">
    </form>
  2. Install the Comments CGI - Connect to your Virtual Private Server via Telnet or SSH and issue this command:

    % vinstall comments

    This will install the comments.pl and util.pl files in your ~/www/cgi-bin/library/comments directory.

  3. Configure allowed recipients - Modify the @recipients_ok line of the comments.pl script to contain the E-Mail addresses of anyone you want to be able to recieve messages from your form. The E-Mail addresses in the form must match the addresses in the @recipients_ok field. This prevents your script from being taken hostage and used by spammers.

    @recipients_ok = ('EMAIL@YOUR-DOMAIN.NAME', 'EMAIL@YOUR-DOMAIN.NAME');
  4. Customize the Comments CGI - Two subroutines in the util.pl file, print_header_info and print_footer_info, are used to print out header and footer information. Feel free to modify these functions such that the CGI outputs pages that are in synch with the motifs of the rest of your site.