Configuration

In the script root folder (the folder that contains all the other folders like /docu/, /inc/, /languages/, /templates/ etc.) you can find the file index.php. That file is basically the configuration file. You can open the index.php file in a text editor.

Options in "index.php"

$referring_server = '';

This variable contains a comma separated list of domains that are allowed to link to the script.

For example:

$referring_server = 'www.example.com, example.com, 200.77.100.166';

Please note: Enter only domain names or IP addresses. Do not enter whole URLS or paths. There can't be any http:// or slashes in there.

If you forget to add your own domain or someone else is pointing to your form from another website, following error message will be displayed:

Wrong or empty referrer (referring site)!

Visitors who have a firewall software installed on their computer may also see get this error message because some firewalls block the referrer. You can work around this by leaving the variable $referring_server empty. This will disable the referrer check.

If you do so, make sure you place your e-mail address directly in the e-mail template. This makes the script useless to spammers, because e-mail can only be sent to the address in the template.

$language

This variable lets you choose the language the script will use for error messages. Take a look into the folder /languages/ in order to find out which languages are available.

$ip_banlist

This variable can contain a comma separated list of IP addresses that want to ban from accessing the script. Be careful, many different users may use a single IP address. If you do not want to use this feature, just leave the variable empty.

$ip_address_count

This variable lets you set the maximum number of e-mails that a user can send during one visit to your web site. Once this number is reached, the user will not be able to send another e-mail from your site until the next time he dial in to the Internet. The number 0 (null, zero) turns this function off.

When you use this feature, the logging function is also turned on. This is necessary so that the script will be able to keep track of the IP addresses of the visitors that are sending mail from your web site. In order for this to work, the directory /logfile/, and the file /logfile/logfile.txt both must have their writable permissions set to chmod 777.

$ip_address_duration

This variable sets the number of hours, from the time someone firsts sends an e-mail from your site, before they can send more e-mails. After the number of hours you set pass, the user can send e-mails from your site again.

$show_limit_errors

This variable lets you decide if you want the script to show an error message, once the user has reached the maximum number of e-mails you have set.

$log_messages

This variable lets you turn the logging function on or off. In order for this feature to work, the directory /logfile/, and the file /logfile/logfile.txt]] both must have their writable permissions set to: chmod 777.

$text_wrap

This variable sets the maximum number of character you want on a line in your e-mail. After this number is reached, a line break will automatically be added. If no value is defined, no line break will be added.

$show_error_messages

This variable is initially set to yes. This will let the script display you error messages during the configuration process. This will help you to install the script. After you have finished configuring the script, you should set this variable to no. Do not leave it set to yes. It is not wise to give visitors to your site a view into the workings of the script.

$attachment

Please find detailed instructions about file uploads and attachments in chapter attachments.

$captcha

Please find detailed instructions about file uploads and attachments in chapter Captcha.

$path['logfile']

This variable contains the path to the log file.

$path['templates']

This variable contains the path to the HTML and text mail template files. The path can be relative (./templates/ or templates/) or absolute (/usr/local/etc/httpd/.../form_mail/templates/). Please be sure to include the ending slash.

$file['default_html']

If you do not specify an HTML template in the form, this variable contains the file name of the HTML template that the script uses by default. The script will automatically use this template.

$file['default_mail']

If you do not specify a mail template in the form, this variable contains the file name of the mail template that the script uses by default. The script will automatically use this template.

$add_text

You can add further values, text, variables or other content to this variable. This content can then be displayed in both the HTML and mail template by using markers/placeholders within curly brackets { and }.

If you want to add your own values to the variable $add_text please follow the pattern from the example entries.

$add_text = array(
    'txt_additional' => 'Additional',
    'txt_more' => 'More'
    );

The first part of each entry is the name of the placeholder. To use the value of txt_addition in your template, place the name of the entry inside curly brackets.

Example: {txt_addition}

The name of an entry must not contain white spaces or special characters. Only the underscore (_) is allowed.