CGI Scripting - Coolmail Manual


The coolmail.cgi program will take user input from a HTML form and e-mail it to you using an e-mail address you specify. To use it include the following HTML line in your web page:

<FORM ACTION="/cgi-lib/coolmail.cgi" METHOD=POST>
You'll also need various boxes for the user to type information into. The easiest to use is a simple text box e.g.:

<INPUT TYPE=TEXT NAME="yourname" VALUE="" SIZE="30">


In the above, NAME must be a unique name for that field (no spaces), value is the default value in the box, and SIZE is the width of the text field.

Another type of field is the TEXTAREA field, this gives your user a multi-line text box for them to type information in e.g.:

<TEXTAREA NAME="youraddress" ROWS="3" COLS="35"> </TEXTAREA>


In the above ROWS the vertical line size of the textarea field and COLS is the width across in characters.

To end your form you need the following two pieces of information:

<INPUT TYPE=SUBMIT VALUE="Click here to submit your entry">


VALUE is the text that appears within the button.

..and also to end the form.
</FORM>
There are several field-names that have special meanings that you can use (those marked with a * are mandatory).

email
If your text field has the NAME "email" then it will be parsed by the CGI to see if it is a valid e-mail address before the information is sent to you and will prompt the user if the address is invalid. This is *not* the e-mail address the information will be sent too but can by used on your form if a user is entering an e-mail address.


*Recipient
This field lets you specify the e-mail address the information will be sent too. Use the following line of HTML code:
<INPUT TYPE=HIDDEN NAME="recipient" VALUE="[email protected]">

Subject
This field lets you specify the subjet line that will be generated when the e-mail is sent. Use the following line of HTML code:

<INPUT TYPE=HIDDEN NAME="subject" VALUE="Web submission">

Logo
This field allows you to choose a logo that will be displayed at the top of the screen in place of the default FastNet logo. To use it, insert the following code fragment:

<INPUT TYPE=HIDDEN NAME="logo" VALUE="urllocationoftheimage">

Background
This field allows you to choose the background image that is displayed on the resulting page. To use it, use the following code fragment:

<INPUT TYPE=HIDDEN NAME="logo" VALUE="urllocationofthebackgroundimage">

Company
This field lets you choose the company name that appears in the ALT tag of the above logo image. To use it, insert the following code:
<INPUT TYPE=HIDDEN NAME="company" VALUE="FastNet International">

Response
This field is optional and allows you to give a different response once the information has been successfully submitted for example, to tailor it to your own unique message. To use it use the following HTML code:

<INPUT TYPE=HIDDEN NAME="response" VALUE="Thankyou for submitting your details">

Goto
Alternatively you can specify a page that the CGI will show once the information has been submitted. The file specified needs to be an absolute link. To use it use the following HTML code:

<INPUT TYPE=HIDDEN NAME="goto" VALUE="http://www.(domain name).co.uk/formOk.html">

Blank
If the user enters nothing in the form then a different page can be shown using the following:

<INPUT TYPE=HIDDEN NAME="blank" VALUE="formBlank.html">
Here is an example of the HTML needed to create a fully functioning form:

<FORM ACTION="/cgi-lib/coolmail.cgi" METHOD=POST>
<INPUT TYPE=HIDDEN NAME="recipient" VALUE="[email protected]"> <INPUT TYPE=HIDDEN NAME="subject" VALUE="Web submission"> <TABLE>
<TR> <TD>Enter your name</TD><TD><INPUT TYPE=TEXT NAME="yourname" VALUE="" SIZE="30"></TD></TR>
<TR> <TD>Enter your address</TD><TD><TEXTAREA NAME="youraddress" ROWS="3" COLS="50"></TEXTAREA></TD></TR>
<TR> <TD>Enter your e-mail address</TD><TD><INPUT TYPE=TEXT NAME="email" VALUE="" SIZE="30"></TD></TR>
<TR> <TD> </TD><TD><INPUT TYPE=SUBMIT VALUE="Click here to submit your entry"></TD></TR>
</TABLE>
</FORM>

Which would result in the following:
Enter your name
Enter your e-mail address
Enter your address