|
How
do I set up a CGI script on my web site which will allow
visitors to send e-mails to my account?
Do
you want a form on your website so you can collect information
from visitors? Here's what you need in order to get that
information delivered as e-mails to your inbox.
First
you need to make sure you have an active cgi-bin.
If
you have a domain name hosted by Drizzle, your cgi-bin should
already exist. If you have a web address like www.drizzle.com/~wimpie,
we may need to set it up. Just e-mail
us, and we'll hook you up.
The
cgi-bin is a directory parallel to your public_html directory.
(The public_html directory is where you've put all of the
HTML files that make the pages of your web site.) You need
an active cgi-bin so that the scripts you drop in there
will function. Once that's done, you may use any CGI script
you'd like. We do not provide support for other people's
CGI scripts, although we do offer CGI programming assistance
for $75/hour.
In
order to have a form show up on your site and return visitors'
responses to you, you'll need to create two new files.
The first one will be the CGI script that makes the form
work. That needs to be put into your cgi-bin directory.
The second will be an HTML file that generates the page
that your viewers will see. That needs to go into your public_html
directory. Each of these files needs to be customized.
We
do offer a FormMail CGI script on our site. Please remember
that we are providing this as a courtesy. We got this freely
available script off the Web. For any questions about how
the script works, please check out the developers' site.
So,
if you want a form on your website:
One:
Copy and paste this FormMail script
into a new file. Open it up. The part close to the top is
where you must make alterations, so the results will be
sent to you. It looks like this:
BEGIN
{
$DEBUGGING = 0;
$emulate_matts_code= 0;
$secure = 1;
$allow_empty_ref = 1;
$max_recipients = 1;
$mailprog = '/usr/sbin/sendmail -oi -t';
@referers = qw(www.drizzle.com drizzle.com);
@allow_mail_to = qw(info@drizzle.com);
@recipients = ();
%recipient_alias = ();
@valid_ENV = qw(REMOTE_HOST REMOTE_ADDR REMOTE_USER HTTP_USER_AGENT);
$date_fmt = '%A, %B %d, %Y at %H:%M:%S';
$style = '';
$send_confirmation_mail = 0;
$confirmation_text = <<'END_OF_CONFIRMATION';
From: you@your.com
Subject: form submission
Two:
You definitely have to change this line:
@allow_mail_to
= qw(info@drizzle.com);
Replace
the highlighted portion with your e-mail address. (If you
wish to allow responses to your form to be returned to more
than one address, you may enter them sequentially, with
a space between each. Then go up to the line:
$max_recipients
= 1;
and
change the number to match the number of e-mail addresses
you have listed.)
Three:
You may have to change another line:
@referers
= qw(www.drizzle.com drizzle.com);
If
you have a domain name, you need to change this line to:
@referers
= qw(www.drizzle.com drizzle.com www.yourdomain.com yourdomain.com);.
If you have a "tilde" web address (like www.drizzle.com/~wimpie),
leave this entry as it is.
Four:
Upload your freshly-customized
version of this form to your cgi-bin directory. Make sure
you set the permissions
so that the script is executable.
Five:
Now you need to create the HTML file that will create the
page that your website's visitors will see and to which
they will post their answers and responses. Here's an example
of a form's appearance.
The HTML that would create that form would look like this.
You can copy that code into a new file, or you can find
another form you like online to alter. To use our example,
copy the HTML into a new file.
Six:
Open the file you've just created. You need to make a few
changes so your HTML form can find the script you just put
in your cgi-bin. The code you need to change is just a few
lines down from the top:
<form
method=POST
action="http://www.drizzle.com/~yourDrizzleuserid/cgi-bin/FormMail.pl">
<input type=hidden name="recipient" value="yourfulle-mailaddress">
<input type=hidden name="subject" value="The
heading you want your e-mail responses sent under">
The
bold entries are what need to be changed (don't make your
personalized entries bold). If you have your own domain
name, the line that says action="http://www.drizzle.com/~yourDrizzleuserid/cgi-bin/FormMail.pl">
should read action="http://www.yourdomainname.com/cgi-bin/FormMail.pl">
Seven:
Change the content of the form so it asks for information
that you actually want.
Eight:
Upload your freshly-customized
version of this form to your public_html directory.
Nine:
Go to your website and send yourself a humorous test response
to your own form.
Quick
links to other FAQ topics
faq
home | dialup/modem
| e-mail
| dsl
| web
| billing
| salon
| shell
| news
| Drizzle
|