This page describes how to access the HTML form-to-mail processing scripts available to CIX Internet subscribers and covers the design of forms to take advantage of these scripts.
There are just a few requirements that your HTML form designs must fulfil, in order for them to work properly.
Always be sure to test your form with the post-query script prior to making it publicly accessible.
There is a script provided for this purpose:
<FORM ACTION="/cgi-bin/post-query" METHOD="POST">
which doesn't send any mail anywhere, but merely echoes your defined field names and submitted data back to your browser. While you are testing your form, it is the script you should use to avoid excessive amounts of test email being generated.
The post-query script doesn't care what field names you define, and so can be used to test forms other than those designed to use the formmail scripts.
The sample form further down is set up to use the post-query script, so you can see how it works.
recipient*, subject, email, realname, redirect
*this field is required, the other four are optional.
If you use an illegal or incorrect value for recipient - no mail is sent and a warning page is displayed.
You can have your own additional fields in your form as you wish.
IMPORTANT - The redirect URL must be fully specified, ie of the form:
http://serveraddress/the/path/to/filename.html
If you are a CIX Internet subscriber, this would therefore need to look something like this:
http://www.compulink.co.uk/~hostname/path/to/filename.html
where hostname is your CIX Internet hostname, and path/to/ is needed only if your form response page filename.html isn't in the top level of your personal www directory.
Of course, you can specify any redirect URL you like - it doesn't have to be to somewhere resident on CIX's Webserver eg:
http://www.yahoo.com/Computers_and_Internet/ http://www.apple.com/documents/aboutapple.htmlare also valid.
<HTML> <HEAD> <TITLE> Form to generate sample output </TITLE> </HEAD> <BODY> <FORM ACTION="/cgi-bin/post-query" METHOD="POST"> <!-- ^^^^^^^^^^ script name Substitute the script name accordingly, above post-query - for echoing values back while testing formmail.pl - verbose email formmailcsv.pl - csv field names and data email formmailcsvd.pl - csv data only email --> <INPUT TYPE="hidden" NAME="recipient" VALUE="someuser@yourhostname"> <INPUT TYPE="hidden" NAME="subject" VALUE="Your Subject Line"> <INPUT TYPE="hidden" NAME="redirect" VALUE="URL"> <!-- Substitute for your required values above, for these hidden fields --> What's your name?<BR> <INPUT TYPE="text" NAME="realname" SIZE=40 VALUE="Your Name"><P> What's your address?<BR> <INPUT TYPE="text" NAME="email" SIZE=50 VALUE="user@address"><P> What's your phone number?<BR> <INPUT TYPE="text" NAME="Phone number" SIZE=20><P> Do you know? Yes<INPUT TYPE="radio" NAME="Illuminati?" VALUE="Yes"> No <INPUT TYPE="radio" NAME="Illuminati?" VALUE="No" CHECKED><P> You can tell us if you want to<BR> <TEXTAREA NAME="Comments" ROWS=10 COLS=50></TEXTAREA><P> <INPUT TYPE="submit" VALUE="Send this information"> <INPUT TYPE="reset" VALUE="Clear Form"></FORM> </BODY> </HTML>
<FORM ACTION="/cgi-bin/formmail.pl" METHOD="POST">
========================================================= Date: Wed, 1 Nov 95 21:00:57 GMT To: someuser@yourhostname From: nobody@compulink.co.uk (CIX Internet WebForm Response) Subject: Your Subject Line Below is the result of your feedback form. It was submitted by: Mr. X (mrx@nowhere.com) on Wed Nov 1 21:00:57 GMT 1995 --------------------------------------------------------- Phone number: 555 2323 Illuminati?: Yes Comments: Maybe I'll tell you tomorrow. --------------------------------------------------------- =========================================================
<FORM ACTION="/cgi-bin/formmailcsv.pl" METHOD="POST">
========================================================= Date: Wed, 1 Nov 95 21:09:22 GMT To: someuser@yourhostname From: nobody@compulink.co.uk (CIX Internet WebForm Response) Subject: Your Subject Line realname,email,Phone number,Illuminati?,Comments Mr. X,mrx@nowhere.com,555 2323,Yes,Maybe I'll tell you tomorrow. =========================================================
<FORM ACTION="/cgi-bin/formmailcsvd.pl" METHOD="POST">
========================================================= Date: Wed, 1 Nov 95 21:09:22 GMT To: someuser@yourhostname From: nobody@compulink.co.uk (CIX Internet WebForm Response) Subject: Your Subject Line Mr. X,mrx@nowhere.com,555 2323,Yes,Maybe I'll tell you tomorrow. =========================================================
This form is shown for illustrative purposes. It is set up to submit the data to the script post-query. No mail is sent by this script, it is used purely to echo the field names and data back to your browser, for testing purposes. When you're sure you have your own form set up correctly, change the script name to one of the formmail ones to enable it.
Go to the Tutorial Index.
Copyright © 1995, Compulink Information eXchange Ltd.