PDA

Click to See Complete Forum and Search --> : Processing forms - a newbie question


wienerdog
06-24-2005, 07:57 PM
I'm a newbie at web design so bear with my basic question. I know you can set up forms in Dreamweaver to be sent to an e-mail address, but I've heard you shouldn't do that, and you should use a cgi file to process a form.

What is a cgi file, and since I'm a graphic designer dabbling in web design, how do I get one written?

cbscreative
06-24-2005, 08:59 PM
A CGI is Common Gateway Interface. Now that you are wowed by the fact that someone actually knows what it stands for, here is some more as non-tech as I can make it.

Perl and CGI are pretty much synonomous. A Perl script is what you will use for a CGI. There are certain security issues so make sure your hosting allows for them. Sometimes they will have their own that you need to use.

Matt's Script Archive has the mmost common for processing forms, it is called FormMail.pl which is the Perl file that will be placed in a folder named "cgi-bin" and usually has to be so named to be found by the programs.

Go to http://www.scriptarchive.com/nms.html to get a secure version of this script, which also explains some of the concerns and security patches.

In a nutshell, you want to avoid having the form on your site being hijacked as a Spam relay which means that someone could send loads of Spam and everyone will think it came from your email address. This version takes care of that risk and makes it so your web forms serve their intended purpose.

As much as everyone hates reading instructions, you will want to do that. This script is well documented and you should be able to customize it easily enough. DO READ it, the Spam relay issues are addressed. You will want to limit the number of emails that can be sent, specify domains it MUST come from (only your own domains), and which email addresses are valid to send to.

The help files will also tell you how to set up pages for confirming to the user that their information was sent. If you want to hide your email from prying eyes, you can do that to. A lot of helpful information is noted at the bottom of the .pl file for configuring and structuring your HTML.

One more thing, there is a debugging line that should be set to 1 by default (user configuration section). Once you are done testing your forms and script, it needs to be changed to zero, making it look like the example below.

$DEBUGGING = 0;

This will be a very good learning experience, though it might seem intimidating at first.

DeleteYourself
06-24-2005, 09:20 PM
Nice info, i've often wondered how to do this as well. Thanks!