Features

CGI Email Forms

This document presents instructions for making web page forms that are sent as email:

Sample files.

You can retrieve these sample files comments.html and comments.txt using your web browser. Save copies of the files in your directory on the web server.

comments.html contains the html code needed to display the edit boxes on your website:

<FORM METHOD="POST" ACTION="http://username.rso.wisc.edu/cgi-bin/cgiemail/xxxxx/comments.txt">
Name: <input name="visitorname" type="text"> <br>
Email: <input name="visitoremail" type="text"> <br>
Comment: <br>
<textarea name="comment" cols="50" rows="10"></textarea>
<br><input type="submit" name="Submit" value="Submit">
</form>

comments.txt contains the email template that will be used to email comments to you:

To: accountname@youremail.com
From: [visitoremail]
Subject: Website Comment

A comment field was completed by [visitorname]:
[comment]

Add your own inputs.

Using the templates as an example, start adding inputs to comments.html. Then add the corresponding "[inputname]" where you want it to appear in comments.txt . This works for checkboxes, etc., not just regular text inputs. You can create new inputs that start with "required-" if you want forms to be rejected if those inputs are blank. Just be sure to change both the .html and the .txt file. If you would like more advanced forms such as a survey, please read this guide.

There are two fields you MUST change for your forms to work:

In comments.txt, change "accountname@youremail.com" to your email address.

In comments.html, change the following line:

<FORM METHOD="POST" ACTION="http://username.rso.wisc.edu/cgi-bin/cgiemail/xxxxx/comments.txt">
where
username
is the RSO's user id (and domain).
xxxxx
is the path to the comments.txt file relative to your root web directory.
If you put the comments.txt file in your root web directory, then the action url should be:
<FORM METHOD="POST" ACTION="http://username.rso.wisc.edu/cgi-bin/cgiemail/comments.txt">
If you are able to display the comments.txt file via the following URL:
http://username.rso.wisc.edu/cgi-bin/cgiemail/myforms/comments.txt
Then the form action should be:
<FORM METHOD="POST" ACTION="http://username.rso.wisc.edu/cgi-bin/cgiemail/myforms/comments.txt">

 

Test the form.

Once you put the comments form on your website, be sure to test it out and send a comment to yourself. If one of your inputs isn't showing up, make sure you typed it exactly the same in comments.html and comments.txt.

Link to the comment form as you would to any other HTML page:

<A HREF="comments.html">Send us a comment</A>

For more information about the cgi form script, see the cgiemail home page.


If you have any questions about this service please email: rso-webadmin@www.wisc.edu

General RSO questions can be directed to the Center for Leadership and Involvement: cfli@odos.wisc.edu