CGI programming is complex, but it can do many things. The most common use of CGI on the net, are fill out forms.
These forms take what you have typed in, and put it in a text file, which is then send to the person or company. There are many fill-out-forms on the net.
Most are guest books, surveys, order forms, etc.
These are not to hard to program for yourself, you just need a few things.
1. The URL or path of the CGI-email program on your server (if you have one) to begin the form. If
you don't have access to your server or ISP, skip this CGI section. You will need that to continue.
The example looks like this:
<FORM METHOD="POST" FORM ACTION="/cgi-bin/cgiemail/guestbok.txt">
2. Now you need to decide what type of input box you will have. Here are some examples:
From: [Name]<[email]>
5. The last thing to do is put a SUBMIT button
and/or CLEAR button in your HTML and then end the form with the appropriate tag.
The buttons are automatically created with the text that you type in the VALUE
statement. It looks like this:
3. Now do the programming for the type of input field that you want. Here is the code:
Fill in the blank:
Pull-Down Menus
Radial buttons:
Check Here:
Or Here:
Or Here:
Check boxes:
Click Here:
And Here:
And Here:
Text Areas:
<INPUT NAME="blank" TYPE="text" SIZE="20">
<SELECT NAME="pulldown">
<OPTION SELECTED>Select Here...<OPTION>#1<OPTION>#2<OPTION>#3</SELECT>
Here:
Or Here:
Here:<INPUT NAME="circle" TYPE="radio" VALUE="1" checked>
Or Here:<INPUT NAME="circle" TYPE="radio" VALUE="2">
Click Here:
And Here:
Click Here:<INPUT TYPE="checkbox" NAME="box" value="1st">
And Here:<INPUT TYPE="checkbox" NAME="box" value="2nd">
<TEXTAREA NAME="comments" ROWS="4" COLS="40"></TEXTAREA>
So that you can understand the code here is some help:
NAME is the name for the input field and can be anything you want it to be. This is the same name
you put in the text file explained next.
SIZE defines the size of a text input field.
TYPE is the type of input field. It can be text, radio, or checkbox.
SELECT must have a beginning tag and an ending tag. The different options are separated by the OPTION tag.
TEXT AREA must have a beginning tag and an ending tag. They also use the ROWS & COLS tag to define the size of the box.
VALUE is what will be printed on the e-mail. Match this to the text you write beside it.
4. The next thing you do is create a text file. Your CGI-Email program reads the input from the html page and places the information in
a text file and then mails it. You need to create this text file and place all the NAME variables inside of the brackets. The FROM, TO and SUBJECT must be first in the text file, but after that
you can put whatever you want to. Save this text file with the same name you specified in the beginning of the FORM tag (Step 1). Mine looks like this:
To: user@somewhere.net
Subject: guest book
Your URL: [url]
Your City & State [hometown]
The code looks like this:
<INPUT NAME="name" TYPE="submit" VALUE="Submit This Thing">
<INPUT NAME="name" TYPE="reset" VALUE="Wipe it Clean"></FORM>
© Surfari Internet Providers
Page last updated on