The config.php file

The config.php file

The config.php file, found in your /global folder contains special settings for to your own Form Tools installation: database connection values, the root folder and URLs and other information. This file is unique to your installation and it's the only file in the script that you need to edit.

The config.php file content is generated by the installation script. It's NOT in the downloadable zipfile.

Whenever you do an upgrade, this file is never overwritten. Any custom settings should be stored in this file. Again: the downloadable zipfile containing the updated Form Tools contents will never contain a config.php, so upgrading is as simple as uploading the new files to your web server and logging back in. [Click here for a more complete discussion of upgrading].

If you've been sniffing around, you may have noticed that the library.php also contains variables defining these values - but DO NOT EDIT THEM THERE! The library.php file contains the default values for all application-wide settings; the config.php just overrides the ones that are necessary. This keeps everything nice and tidy and simplifies upgrading.

Required Settings

$g_root_url
This is the base URL of the Form Tools installation on your server. e.g. http://www.yoursite.com/formtools. You can either supply an absolute or relative URL. Note: if you include the full URL, make sure that the "www." part is either included or removed consistently; if you try to log in at http://www.yoursite.com/admin but your $root_url is set to http://yoursite.com/admin it will not work! (and vice versa).
$g_root_dir
The server directory path to your Form Tools folder.
$g_db_hostname
The database hostname (often just 'localhost').
$g_db_name
The name of the database. Most often, hosting providers provide you with some sort of user interface for creating databases and assigning user accounts to them. If you are creating a new database for Form Tools, I would recommend "form_tools" for clarity. Enter the database name here.
$g_db_username
The MySQL username. Note: this user account must have privileges for creating new tables, in addition to adding and removing records.
$g_db_password
The MySQL password.

Optional Settings

$g_db_ssl
This should be set to true if you want to make a secure connection to the database server.
$g_table_prefix
This value lets you define a custom database prefix for your Form Tools tables. This is handy if Form Tools will be added to an existing database and you want to avoid table naming conflicts. By default it it set to ft_. If you do not need to use a different value, you needn't define it in your config.php file: it is already defaulted to ft_ in your library.php file.
$g_max_nav_pages
This controls the maximum number of pagination links that appear in the Form Tools UI (e.g. for viewing the submission listings page).
$g_unicode
This offers support for unicode. All form submissions will be sent as UTF-8. This is enabled for all new installations.
$g_check_ft_sessions
This setting should be enabled prior to including this file in any external script that doesn't require the person to be logged into Form Tools. The API, for example, automatically sets this to false. This lets you leverage the Form Tools functionality in the outside world without already being logged into Form Tools.
$g_default_error_reporting
For release candidates and main releases, this is set to 1 by default, meaning that only genuine PHP errors are displayed. For Beta releases, this is set to 2047 - all errors and warning are displayed, which can help with debugging.
$g_debug
This feature currently only has limited support in the code, but will be implemented more fully at a later stage. When set to true it provides detailed, technical reasons for errors that occur.
$g_smarty_debug
When enabled, this option pops open a Smarty console for each webpage, displaying the contents of variables available on the page.
$g_smarty_use_sub_dirs
This tells Smarty to create the compiled templates in subdirectories, which is slightly more efficient. It's not compatible on some systems, so it's set to false by default.
$g_query_str_multi_val_separator
This determines the value used to separate the content of array form submissions (e.g. checkboxes in your form that have the same name, or multi-select dropdowns) when submitted via a query string for "direct" form submissions (added in version 1.4.2).
$g_delete_module_folder_on_uninstallation
For module developers. This prevents the code from automatically deleting your module folder when you're testing your uninstallation function. Defaults to TRUE, but doesn't work on all systems: sometimes the PHP doesn't have the permission to remove the folder.
$g_session_type
This setting lets you control the type of sessions the application uses. The default value is "php", but you can change it to "database" if you'd rather use database sessions. This affects all Form Tools accounts and determines the session type for forms that are integrated with the API.
$g_session_save_path
This setting was added in 2.0.0-beta-20090614. It lets you define the location where temporary PHP sessions files should be created. Generally you won't need to define this value, but some hosting providers (e.g. iPowerWeb) require that you do so in order to use sessions.
$g_api_debug
This enables debugging for the API functions. Generally this just causes the database errors and other messages to be outputted along with the problem error code. Enabled by default.
$g_api_recaptcha_public_key
Used in the ft_api_display_captcha function when displaying a CAPTCHA in your form. Please see that function for more information.
$g_api_recaptcha_private_key
Used in the ft_api_display_captcha function when displaying a CAPTCHA in your form. Please see that function for more information.
$g_api_header_charset
This setting determines the header charset sent by the ft_api_init_form_page API function. Defaults to "utf-8".
$g_api_sessions_timeout
Determines how long sessions last for the API. This value defaults to 1 hour (3600 seconds).
$g_filename_char_whitelist
Permissible characters in a filename of files uploaded to Form Tools. All other characters are stripped out.
$g_password_special_chars
Special chars, required in password (optional setting through interface).
$g_password_special_chars
Special chars, required in password (optional setting through interface).
$g_password_history_size
The size of the password_history setting in the settings table. Form Tools keeps track of the last 10 passwords, to (optionally) prevent users from re-using a password that they used before.
$g_search_form_date_field_format
In Form Tools 2.1.0, when you search on a date field on the main Submission Listing page, you will see a javascript dialog window to let you search by range, before a date, etc. This setting controls the format of that date. This is deliberately simple: you have only two options: d/m/y and m/d/y.
$g_max_ft_forms
Added in 2.2.3, this setting limits the Form Tools installation to only manage the number of forms specified here. This feature is disabled by default.
$g_max_ft_form_fields
Added in 2.2.3, this limits all Form Tools forms to a certain number of fields. This feature is disabled by default.
Edit Page