Get great deals from the
Internet via E-mail
CLICK HERE

Member Newsletter
 
 BUILD YOUR SITE

Beginning: Receiving Email from your Site Using Freeservers' Form Emailer

Whenever you click on a "Contact Us" link on a professional, well-programmed Web site, often a Web page with a form loads into your browser. You enter specific information and click "Submit," and your information is magically transported to the company you want to contact. Receiving information that a visitor submits through an online form requires a CGI (a program that runs on the server and tells the server what to do with the submitted info). Often this requires hiring an expensive programmer to create the CGI for you. However, the programmers at Freeservers have already created a CGI that collects the information from your form and sends it to you. We call this CGI the "Form E-mailer" and have made it available to all Freeservers members. With just a few simple HTML codes, you can have information e-mailed to you directly from your Web site.

There are a few HTML tags you will need to be familiar with in order to use the Form E-mailer. First, you need to know what tags you use to create a form. Here is a list of each tag you can use in a form and what that tag does:

HTML Tag How It Looks What It Does
<FORM METHOD="post" ACTION="/cgi-bin/cgiemail"> Not Visible This tag tells the browser that you are starting a form in your HTML page. In Netscape, if you do not include this tag, your form will not show up on your Web page. Also, without this tag, the CGI will not know what to do with the form once it is submitted by visitors to your site.
<INPUT TYPE="text" NAME="street_address" VALUE="some_value"> This tag will create a text field where visitors can enter information. You may notice in many of these tags there is a TYPE, a NAME and a VALUE. The TYPE tells the Web browser what type of form field to create. You specify a NAME so that when you receive the e-mail from this form you know which part of the form the information belongs to (for example, if you have NAME="street_address", when you receive the e-mail it will contain street_address, followed by the information your visitor entered into this field). NAME cannot have any characters other than numbers, letters, underscores ( _ ) and dashes ( - ), and cannot have any spaces in it. VALUE is optional. If you add VALUE, whatever you put for VALUE="" will appear automatically in the text field, as it does in our example.
<INPUT TYPE="checkbox" NAME="send_info" VALUE="yes"> This tag will create a check box in your form. NAME and VALUE do the same thing as in the text field. If your visitor checks the text box, you will receive the NAME and VALUE in your e-mail. Otherwise, it will send the NAME without the VALUE.
<INPUT TYPE="radio" NAME="browser" VALUE="Internet Explorer" CHECKED>
<INPUT TYPE="radio" NAME="browser" VALUE="Netscape">
<INPUT TYPE="radio" NAME="browser" VALUE="Other">


These tags will create radio buttons. There are three tags so you can see how radio tags interact with each other. Notice how all three tags have the same NAME. Because the names are the same, if you click on one radio button, it will unselect the other radio buttons. If they all had different NAMEs, you could select all of the radio buttons, but since radio buttons are used so that a visitor can only select one option, you want to make sure that all of your radio buttons have the same NAME. The e-mail you receive will have the NAME and the VALUE of whichever radio button the visitors select, so you know which one they picked. CHECKED selects a radio button automatically when the Web page loads, which the visitors can change if they would like.
<INPUT TYPE="password" NAME="password"> The password tag allows your visitors to enter text into a text field. However, no matter what text they type, the only characters that will appear on the screen are asterisks ( * ). In the e-mail that is sent to you, the real text they entered will be included.
<SELECT NAME="gender">
   <OPTION VALUE="female">Female
   <OPTION VALUE="male">Male
</SELECT>
The SELECT tag creates "drop-down menus." The NAME has the same function as it does for the other form tags. However, you place the VALUE for each item in your drop-down menu in the OPTION tags that follow the SELECT tag. Each OPTION needs a unique value, which will be sent to you in the e-mail. After each OPTION tag, place the text you would like to show in your drop-down menu. You can have as many OPTIONS as you would like.
<TEXTAREA NAME="comments" COLS="20" ROWS="8">Enter Text Here</TEXTAREA> The textarea tag allows you to have a large text box where visitors can enter large amounts of text. This tag is a little different from the others, since if you want to enter default text that will appear automatically when your Web page loads, you enter it between the opening and closing TEXTAREA tags. If you do not enter text between these two tags, nothing will appear in the text box when the Web page first loads. COLS and ROWS controls the width and size of the text box, respectively.
<INPUT TYPE="submit" NAME="submit" VALUE="Send Info"> This button submits the form once the visitor has finished filling it out. NAME can be whatever you would like, as long as it is different from all of the other NAMEs in the form. Whatever text you put in VALUE will show up as the text on the button. You need to include a button if you would like visitors to send you the information in the form.
</FORM> Not Visible At the end of your form, you must include this tag. Without it your form may not work correctly. This tag tells the Web browser that your form ends at this point on the page.

As long as you place the <FORM METHOD="post" ACTION="/cgi-bin/cgiemail"> tag at the beginning of the form and a </FORM> form at the end, you can use the other elements listed above as many times and however you would like. Keep in mind that the NAME for each element must be unique (except for radio buttons).

Here is an example of a form's code, with the working form below:

<FORM METHOD="post" ACTION="/cgi-bin/cgiemail">

Full Name: <INPUT TYPE="text" NAME="full_name">

E-mail Address: <INPUT TYPE="text" NAME="email">

What is your favorite color?
<INPUT TYPE="radio" NAME="color" VALUE="red"> Red
<INPUT TYPE="radio" NAME="color" VALUE="blue"> Blue
<INPUT TYPE="radio" NAME="color" VALUE="green"> Green

Please leave me any comments about my Web site:
<TEXTAREA NAME="comments" COLS="50" ROWS="10"></TEXTAREA>

<INPUT TYPE="submit" NAME="submit" VALUE="Thank You!">

</FORM>


Here is how it will look:



Full Name:

E-mail Address:

What is your favorite color?
Red
Blue
Green

Please leave me any comments about my Web site:






Anything submitted through this form on your Web site would be e-mailed automatically to whatever e-mail address you have listed in your Account Settings for your Freeservers account. If you are using Webmail, it will be sent to webmaster@YOURDOMAIN.com.

If you would like more information on the Form E-mailer, including various options you can include in your forms, visit our help section by clicking here and locating and clicking on the "Form E-mailer" link in the left-hand menu.





 
My Member Area | Stats / Reports | Help Resources | Upgrade Services | Account Info | Company Info | Acceptable Use Policy | Privacy Policy | Feedback
Get great deals from the
Internet via E-mail
CLICK HERE