Modifying and Adding to formmail.cgi

Like all the free scripts offered here at bumblebeeware, the program is basic to allow coders to add functionality to the programs. We could never plan for what anyone person will need and the people using our scripts often use the same programs for multiple clients with unique tweaks for their business. Bu here are a few ideas in the bin that may help develop the program further.


Adding A Dynamic Redirect

The current configuration uses a static redirect defined in the program. If you plan to use multiple forms on the smae website you will want to direct people to different pages for different forms. The solution is relatively simple.

Add a hidden field to your form with the url you want to direct the user to.

<input type="hidden" name="sendtopage" value="http://someplaceelse.com">

In the formmail.cgi modify

# page to send user to after submitting form
$sendtopage = "http://mydomain.com/thankyou.html";

Change the field to use the form fiel you have defined in the hidden field.
$sendtopage = "$form{'sendtopage'}";

This will give you the ability to define the page using the html forms.

Ofcourse that is the answer to many other options, add a hidden fieldd and let the program use the value to decide what action to take.


Securing DiretoriesThe standard configuration is not secure for use. You will need to password protect the captcha directory or move the directory to a web inaccessible directory. If you need a program to generate passwords for your folders, use the password program we have ready to download.


Dynamic Image Captcha

Using the standard <img src="captcha.cgi"> will cause some reloading problems in older browsers or those set for slower dialup connections.

By adding a dynamic querry string you will insure that older browsers will load a new image each time the page is accessed.

<img src="captcha.cgi?randomnumber">

Older browsers cache one image as the only image to be displayed. By using a form.cgi the random number can be printed right to the page by the program. Of course any dynamic page like asp, jsp and so on could easily do the same thing. It will also confuse the hell out of the scammers who think the random string has some relationship to the text on the image.

If you are using shtml or server parsed pages you can use the time function to create a dynamic number for the cgi with:

<img src="captcha.cgi?<!--#config timefmt="%s" -->
<!--#echo var="DATE_LOCAL" -->">

See the captcha for perl help pages for more details and options.