CoreComm: Internet Access and Web Hosting Home My Account Home Home Home
  Today is Saturday, November 7th
Powered by Google  Web Search   


Tools & Info
Support Library
Suggested Reading
Help & Support
Web Host Support
Dial-up Support

Need More Info?
Web Host Support
1-877-890-5310

HiCap Support
1-877-582-0056

DSL Tech Support
1-888-899-1500




Print This Page


Using the "formcgi" mail script

Online forms require a cgi script to E-Mail you the results.
As of February 1999, our Virtual Servers have a script called formcgi installed by default; ready to use.
The use of formcgi is free with your Virtual Web server.

NOTE: If you were moved from an older Virtual Web server and do not have formcgi in your cgi directory, E-Mail domainsupport@core.com and we'll be happy to install it for you.

Quick start instructions:

To use formcgi, there are only two tags required in your form. Add the following html tag as the form ACTION line in your form.html:

<FORM METHOD=POST ACTION="http://www.your_domain.com/cgi/formcgi">

Under that, add this line, it tells the form who to mail the form results to:

<INPUT TYPE=HIDDEN NAME="to" VALUE="user@your_address.com"> That is all that formcgi requires. However, there are more in-depth features that you can use with formcgi, we will go into those below.
Introduction
This program E-Mails you the data that a user fills out on an HTML form.

You can let the program display a simple confirmation page, or you can design your own echo page, with all the usual Web page design elements that you want to use. Alternatively, you can redirect the user to a page on another server, as soon as the form is submitted.


Usage

To use the program, edit the "action=" part of the <form> tag on your HTML page, like this: <form method="POST" action="http://www.your_domain.com/cgi/formcgi">

Script Control Variables

To tell the program what to do, you can include any of several script control variables anywhere between the <form> and </form> tags. They're all optional, except "to." These variables are case sensitive. The "to," "subject" and "email" fields are all lowercase letters, for compatibility with the earlier program.

Mailing the Data

"to"

First, put your E-Mail address in the "to" field, so the program can mail the data to you. <input type="hidden" name="to" value="you@your.org"> You can mail the data to more than one address, like this. <input type="hidden" name="to" value="you@your.org, other@your.org"> If you want to do everything as simply as possible, you can stop reading right now, because "to" is the only script control field you really need.

"cc"

Another way to mail the results to more than one person is to use the "cc" field. Addresses in "cc" won't appear as mailto links on the standard echo page. <input type="hidden" name="cc" value="other@your.org, someone@your.org">

"subject"

The standard subject is "Web Form Data," when the program mails you the data from the form. You can change it like this. <input type="hidden" name="subject" value="My Own Subject Line">

Standard Echo Page
When the user submits the data, the program displays a page confirming the data that the user filled out. If the form includes an "email" field and the user filled it out, it also mails a duplicate copy of the data to the user.

"ReturnLinkURL"
"ReturnLinkTitle"

The standard echo page includes a link back to the form, with the title "Return to the Form." You can substitute a link to any page you want, like this. <input type="hidden" name="ReturnLinkURL" value="/rec/fakedir/">
<input type="hidden" name="ReturnLinkTitle" value="The Curling Page">

"MailToAddress"
"MailtoName"
"MailtoPrompt"

If you want to display a different mailto link on the standard echo page, instead of the address to which the program sends the data, you can do it like this. <input type="hidden" name="MailtoAddress" value="other@your.org"
<input type="hidden" name="MailtoName" value="Betty B. Boomer"> The standard prompt for the mailto link is "Questions:" but you can change that too, with this line: <input type="hidden" name="MailToPrompt" value="For more info:">
Your Own Echo Page
The standard echo page is XMPtty generic. If you want to say something specific to the user, or display a nicer looking page when the user submits the data, you can define your own echo page.

"EchoFilePath"

<input type="hidden" name="EchoFilePath" value="/u/http/web/vlogin/echo.html"> Vlogin is your virtual server login name. You can design your echo page however you like. You'll have to include your own mailto and return links, because the script control variables for the standard echo page (above) can't write those links to your echo page.

You can use either .html or .htm as a file extension for your echo page. For security reasons, the program won't read files with anything other than these HTML file extensions. In other words, if a file has world-readable file permissions and is an HTML file, it must be okay to display it, but otherwise it isn't. You also can't use any file path that starts with a dot (.)

If you want the program to display the user's input data on your echo page, include the following comment line in the file, where you want the user data to appear.

    <!--ECHO DATA HERE-->

Redirection to Another Page

"RedirectURL"

To display a page on another server as an echo page, you can use the RedirectURL variable. It's not possible to echo user data from the form onto a redirected page. <input type="hidden" name="RedirectURL" value="http://www.any.org/page.html"> If the page is on your server, you can shorten this to a relative URL. <input type="hidden" name="RedirectURL" value="/somedir/hi.html">

User Data Fields

"Required"

This script control variable can apply to any of the data fields that the user fills out. You can refuse to accept the form unless the user puts something (anything) in certain fields. With a generic program like this, it's difficult to validate the input data from completely random and unknown fields. So we don't. (We could make a stab at it for numeric fields, but it wouldn't be XMPtty for alphabetic or alphanumeric fields.) So the user could enter, for example, "qwerty" and the program would accept it.

It's a good idea to use required fields sparingly. Users dislike them, especially if they ask for "none of your beeswax" information. Ask yourself, "Would the data be completely and utterly useless without this field, or not?"

<input type="hidden" name="Required" value="Bald,Teeth,Shoes">

"email"

This is the user's E-Mail address. It's the only user data field with a specific name (and it's case sensitive). You can make this a required field or not, as you like. But if it's on the form and the user fills it out, then the program checks to make sure it has a valid E-Mail address format, because the program uses it to send a duplicate copy of the data to the user. If it's not in the right format, the program notifies the user.

You can include any other data fields, and name them whatever you want. The program includes the name and contents of each field in the E-Mail that it sends you.

<input type="text" size="48" maxlength="80" name="Shoes">

Referrer Check
For security reasons, the program compares the IP address of the server that submitted the form against a list of allowable servers. In this case, the list is extremely short. If the form isn't hosted on this server, the program won't even read the input from it.
Internet - Hosting
Copyright © 1996 - 2009 CoreComm Internet Services, Inc. All Rights Reserved.