| Creating online forms
SuperForm handles data submitted via your WWW forms. SuperForm was created exclusively for AAPT Web customers and works only if your Web server is at connect.com.au. SuperForm is located in your cgi-bin directory as superForm.cgi SuperForm offers several features. You can:
<form method=post action="/cgi-bin/superForm.cgi">To email a specific person, add a "nickname" to the mail.list file in the cgi-bin directory in the following format nickname: me@my.email.address For example, to have two people receive results delivered to the nickname
survey, the following line should appear in the mail.list file:
(note: if there are more than 5 email recipients the form will fail)
To make a field mandatory, you need two lines of code
<input type="hidden" name="from-name-MANDATORY" value="true"> <input type="text" name="from-name" size="40">To call a page when the form is successfully submitted <input type="hidden" name="next-url" value="/path/to/success/file.html">Some other automatic fields are
Notes:
|
|
superForm.cgi - Troubleshooting Guide
The most common problem's with superForm.cgi are:
To call the superForm.cgi in your form to mail a "specific person" without using nickname's, you need the following FORM tags. <form method=post action="/cgi-bin/superForm.cgi"> <input type="hidden" name="from-email" value="username@companydomain"> <input type="hidden" name="to-email" value="username@somedomain">
To email multiple person/s, add a "nickname" (max of 5) to the mail.list file in the cgi-bin directory in the following format.... selected_nickname: this@email.address, that@email.address, andtheother@email.address
For superForm.cgi to use nicknames you need to set $useNicknames = 1;(if you dont want to use nicknames set the value to = 0) The html should look like this.... <form method=post action="/cgi-bin/superForm.cgi"> <input type="hidden" name="to-nickname" value="a_nickname_in_mail.list"> <input type="hidden" name="from-email" value="username@companys_domain_name"> The format that nicknames in mail.list should appear is as follows.... nickname:emailaddress (e.g., sales:@billjones@companyname.com.au) If you want multiple email addresses (Max of 5) to append to a nickname the format is as follows nickname:emailaddress,emailaddress,etc (e.g., sales:bill@companyname.com.au,barry@companyname.com.au,fred@companyname.com.au)
To make a field mandatory, you need two lines of code
<input type="hidden" name="from-name-mandatory" value="true"> <input type="text" name="from-name" size="40"> To call a page when the form is successfully submitted <input type="hidden" name="next-url" value="/path/to/success/file.html"> Any fields that are in the form will be emailed to the person defined in the nickname field. |
|
Generally superForm.cgi needs very little alteration, but this is a list of the most common area's where webmasters tend to alter superForm.cgi and cause it to break. It is always recommended that you make an unchanged copy of superForm.cgi as a backup. The red coloured area's denote how it should be configured (companyname.com.au
refers to your domain name).
require "cgi-lib.pl";
# ------------------------------------------------------------
# Configurable variables
# True if must use nicknames
$useNicknames = 1; (or 0 if not using nicknames)
# The name of the default nickname file under the referrers server root
$nicknameFile = "cgi-bin/mail.list"; (or a filename of your own choosing)
# The name of the administrator
$adminName = "www.companyname.com.au webmaster";
# The email address of the administrator
$adminAddress = 'webmaster@companyname.com.au';
# The location and flags of the sendmail program on your system
$sendmailProg = "/usr/lib/sendmail";
# The location of the pgp executable on your system
$pgpProg = "/usr/local/bin/pgp";
# The default name of the pgp public keyring for pgp encryption.
# Relative to $serverRoot
$pgpKeyringDir = ".pgp";
# Define true if you have BSD flock in your perl
$haveFlock = 1;
# End of Configurable variables
# ------------------------------------------------------------
ReadParse(*input); # grab cgi parameters
# Debugging support
#print &PrintHeader;
#print &PrintVariables(%input);
#print `env`;
###########################################################################
# Find their server root dir and make sure they are 'one of ours'
# First the domain name of the referer
if ($ENV{'HTTP_REFERER'} =~ /http:\/\/([^\/]*)\/.*/) ( /http[s]?:\/\/([^\/]*)\/.*/ if HTTPS is enabled)
{
$serverRoot = "/www.companyname.com.au/";
chomp $serverRoot;
error("Can't determine server root directory. Perhaps your Web
server is not at <a href=http://www.companyname.com.au>DOMAINNAME</a>")
if $serverRoot eq '';
|
More information is available on SuperForm in the documentation within SuperForm itself which you can find by entering the command "cat superForm.cgi" at the prompt in your cgi-bin directory. |
| Copyright © AAPT Limited |
|