The easiest DIY way is to use a program called formmail. It's a
Unix/linux based perl script, but windows has a version that works
almost exactly the same way. Basically it is run from an html page
which can have text entry fields, text editing areas, popup (dropdown)
boxes, checkboxes, pushbuttons, and radio buttons. The typical bottom
pushbutton is the "submit" button.
When the program runs, it parses the field entries and creates an
e-mail containing the information filled in by the user of the page.
It's not a real time interactive web page, it doesn't stuff databases
for you, or anything, but it gets the information to you.
Here's the code from a form I have on my auto repair advice website
It has most all the commands and gives you a general idea of how
things work.
<FORM ACTION="/cgi-bin/formmail.cgi" METHOD="POST">
<!.. This line tells which formmail program is in use: check with your
hosting company as to the exact program name, or there are a number of
them available for download ..>
<INPUT TYPE="HIDDEN" NAME="to" VALUE="george@econofix.com">
<!.. This is the line telling which e-mail address to send the information to ..>
<INPUT TYPE="HIDDEN" NAME="subject" VALUE="Estimate Request">
<!.. This tells what the subject of the e-mails will be: my mailbox
gets e-mails titled "estimate request"..>
<FONT COLOR="#FF0000">Get an estimate by e-mail! Just submit this
form............ </B>
<!.. this is is just html stuff.. it could say anything. ..>
<INPUT TYPE="submit" VALUE="Submit">
<!.. This makes the "submit" pushbutton ..>
<INPUT TYPE="reset" VALUE="Clear">
<!.. This makes a "reset" pushbutton, which clears all the entries on the form ..>
<FONT COLOR="#FF0000">
<p>Name...<INPUT NAME="Name" TYPE="text" SIZE="25">
<!.. This creates a blank "text" field for the variable called "name".
The field will be 25 characters long. ..>
....Phone...<INPUT NAME="Phone" TYPE="text" SIZE="15"><br>
<!.. same thing, only 15 characters long and the variable is called "phone" ..>
E-mail Address...<INPUT NAME="from" TYPE="text" SIZE="30"> <p>
<!.. "From" is a special variable: it will become the "from" line in
the e-mail you receive from the formmail program ..>
Car Make...
<INPUT NAME="Make" TYPE="text" SIZE="15">
Model...
<INPUT NAME="Model" TYPE="text" SIZE="15">
Year...
<INPUT NAME="Year" TYPE="text" SIZE="4"> <p>
Engine Size
<INPUT NAME="Engine Size" TYPE="text" SIZE="9">
<!.. all the above just plain text entry boxes ..>
<p>Describe the repairs needed<br>
<TEXTAREA NAME="Repairs" ROWS=2 COLS=70></TEXTAREA>
<!.. This creates a text editing area, 2 rows by 70 columns
<INPUT TYPE="HIDDEN" NAME="redirect" VALUE="http://econofix.com/index.html">
<!.. This is the page you are sent back to after pressing the submit button. ..>
<p>
</form>
You can see this form at econofix.com/formail.html
This doesn't have popups or buttons: here's another page I wrote that does...
<form action="/gdform.asp" method="post"> <!.. Please note: this is a
site hosted by go Daddy: the windows based program is named
"gdform.asp". The actual html code is almost identical. ..>
<INPUT TYPE="HIDDEN" NAME="subject" VALUE="Internet Patient">
<FONT COLOR="#000000">
<STRONG>PATIENT INFORMATION FORM
<P>
<br>First Name... <INPUT NAME="First Name" TYPE="text" SIZE="30">
Last Name... <INPUT NAME="Last Name" TYPE="text" SIZE="30">
<br>Address... <INPUT NAME="Address" TYPE="text" SIZE="50">
<BR>City ...<INPUT NAME="City" TYPE="text" ................blah, blah,
blah......I won't give you the rest: it's a LONG form!.....here's the
new stuff...
Marital Status...
<SELECT name="Marital Status" size=1>
<OPTION>SINGLE
<OPTION>MARRIED
<OPTION>WIDOWED
<OPTION>OTHER
</SELECT>
This makes a popup/dropdown selection box. The variable is called
"marital status. It defaults to the first item, can be filled with
the others.
<SELECT name="Employment" size=1>
<OPTION>FULL TIME
<OPTION>PART TIME
<OPTION>RETIRED
</SELECT>
Here's another one
<INPUT TYPE="radio" NAME="PT YN" VALUE="YES" >YES
<INPUT TYPE="radio" NAME="PT YN" VALUE="NO" >NO
This is a 2 position radio button, just for a "yes/no" option. To get
more choices, add more lines
<INPUT TYPE="radio" NAME="PT YN" VALUE="NO" >NO
<INPUT TYPE="radio" NAME="PT YN" VALUE="yes" >yes
<INPUT TYPE="radio" NAME="PT YN" VALUE="maybe" >maybe
<INPUT TYPE="radio" NAME="PT YN" VALUE="don't care" >I don't care
Notice that "name" is the name of the variable, value is the value for
pressing that button, and the text outside the html containers (the
"<" and ">") is the label which will appear by the radio button.
This form is viewable at http://gainesvillephysicaltherapy.com/formail.html
I don't have a checkbox example, but it's almost the same as the radio button.
<input type=checkbox name=MyNewCheckbox>Check my new checkbox!!
<input type=checkbox name=MyNewCheckbox checked> Check my new checkbox!
Note that the bottom has the "checked" command: this means the
checkbox will be checked when the form is displayed. clicking it will
then 'uncheck" it.
The "checked" command can be used with radio buttons too: the
difference is that any or all of checkboxes can be selected, only one
radio can be selected.
By the way, if you see a form you like, you can go "view" then
"source" on your browser to see the code that made it. You can just
copy it and change it around to fit your purpose! (Hey, that's how I
learned to write html!)
Hope this has helped!
George |