Location: PHPKode > scripts > easiForm > easiform/easiForm/easiForm_config.php
<?php // easiForm v1.3
/**************************************************************************************************************************
*
*   easiForm - An easy to use php form processing scipt for your web forms - For PHP 4.2.0 and above.
*
*   easiForm_config.php
*   Configuration script for the above easiScript.
*
*   This config script should be uploaded to the same directory as the easiForm file.
*
*	Version History:
*
*	-- 1.0 -- [ 1st September 2007 ]
*	 > 1.2 -- [ 28th September 2007 ]       - Option for 2 to be used with $ACTSUCCESS. 
*                                           - $easiMail_success added as a flag on success.
*	                                        - Fixed the HTML chars option and added $eF_asr.
*	-- 1.3 -- [ 29th September 2007 ]       - Added badwords checking.
*                                           - Added error variable options at end of this file.
*
*   http://www.easibase.com/
*
**************************************************************************************************************************
*	                                                        WARNING
**************************************************************************************************************************
*
*	The author accepts no responsibility for loss or damage caused through the use of this form.
*
*	Although we have implimented fairly tough security and filtering for spam bots we cannot
*	fully guarrentee that this in-built security and filtering to stop spam totally... but we are fairy
*	confident it will stop most cases... if not all.
*
*	NOTE: Security is extreamly important when using forms, although some options can be set from your actual form we 
*   recommend not to set them that way. Another option if using multiple forms in the same directory that need a different 
*   configuration would be to create a separate directory for each form and therefore a separate config file with different
*   settings for each form, if your forms do not need different settings then the same config file can be used with them all.
*
**************************************************************************************************************************
*	                                                        IMPORTANT
**************************************************************************************************************************
*
*	In case you are thinking there is a lot of text here for so very few settings and it can only be complicated! not true,
*   the reason for this is we want to try and make everything as clear as possibe for those who are not used to working
*	with scripts, so everything has been clearly explained, or at least tried to be!
*
*	How this script functions on your server is unknown, different servers have different settings and a servers particular
*	configuration may prevent this script from running. Generally there shouldn't be a problem but it is advised to check
*	that this script works with the server hosting the domain it will be used on before making a purchase.
*	The author takes no responsibility for this form not working, if your ISP or anyone else changes your server settings
*   after this script has been purchased no refund will be given, although you are welcom to contact us to see if there is
*   any other solution.
*
*	When editing this configuration file it is important to do so with care, removing / adding a ' or other character where
*   it is or maybe isn't needed may cause the easiScript to break. Most lines 'But not all need to end in a ; so do not
*   remove or add any of these. 
*   Some variables 'STRING' are enclosed within single quotes 'example', some of these may contain a space after the
*   content such as 'WEB: ', if altering these strings then make sure you leave the space in the string.
*
*   If you just want to simply set your the email address for your form information to be sent to and add the thanks page
*   address then scroll down to or search for SETTINGS NEEDED 'approx line 136' and enter your e-mail address, if you want
*   to know more of how you can customise your forms then read on...
*
*	A little bit about variable values explained, with the more complicated one first...
*
*	An ARRAY is a variable array that can contain many variables in one container.
*
*   Correct:	$f['variable'] = true;
*   Correct:	$f['variable'] = 'some string';
*   Correct:	$f['variable'] = 25;
*   INCORRECT:	$f'variable' = 'some string';
*   INCORRECT:	$f('variable') = 'some string';
*   
*   An array is used for your form field/menu/radio values.
*
*	A BOOLEAN value of true or false should not have any ' at the start or end followed by a ;
*
*	Correct:	$variable = true;
*	Correct:	$variable = false;
*	INCORRECT:	$variable = 'true';
*	INCORRECT:	$variable = true
*	INCORRECT:	$variable = 
*	INCORRECT:	$variable = ;
*
*	A STRING value must have a ' or " at the start and ' or " at end, if it uses ' at the start
*	then it must use the same at the end followed by a ;
*
*	Correct:	$variable = 'somedomain.com';
*	Correct:	$variable = "somedomain.com";
*	Correct:	$variable = "\n"; // an \n must use double quotes!
*	INCORRECT:	$variable = '\n';
*	INCORRECT:	$variable = 'somedomain.com";
*	INCORRECT:	$variable = 'somedomain.com'
*	INCORRECT:	$variable = somedomain.com;
*	INCORRECT:	$variable = 
*	INCORRECT:	$variable = ;
*
*	A NUMBERIC value of a number, should not have any ' at the start or end followed by a ;
*
*	Correct:	$variable = 2;
*	Correct:	$variable = 0;
*	INCORRECT:	$variable = '2';
*	INCORRECT:	$variable = "2";
*	INCORRECT:	$variable = 2
*	INCORRECT:	$variable = 
*	INCORRECT:	$variable = ;
*
***************************************************************************************************************************
                                                            DESCRIPTION
***************************************************************************************************************************

    IMPORTANT

    If any of the values that are permitted to be set as a hidden field are set so then
    one of three things need to be done to the line in this file that contains that variable:
   
    1# The same variable line below needs to be changed to:

    $THEVARIABLENAME = $THEVARIABLENAME;

    2# The same variable line below needs to commented out and so changed to:

    // $THEVARIABLE = 'whatever_it_is';
   
    We suggest using the // option so you know later which lines you have edited out.
    
    If this is not done then the variable value here will overwrite the value set 
    as an invisible field in your form.

    3# Do can choose not use this config file, if this option is used then you must
       set any needed variables in the actual form. 
       Note doing this will reduce form security and is not recommended, it will
       also dramatically reduce your form message options.
       
    * You should know that using any values as hidden fields leaves these variables open to manipulation.

***************************************************************************************************************************/

$eF_NewLine			= "\n"; // DO NOT EDIT.
$eF_asr             = true; // DO NOT EDIT - (All slash removal).

/***************************************************************************************************************************
*                                                       SETTINGS NEEDED
****************************************************************************************************************************

    DO NOT REMOVE ANY # PLACED BEFORE A LINE OF TEXT UNLESS DIRECTED TO DO SO OR THIS SCRIPT MAY NOT FUNCTION.
    Each variable will be named before it's use, then the type of variable it is 'STRING, BOOLEAN etc.', if the variable
    needs a value for easiForm to run then that will be stated as - NEEDED VALUE. A brief explaination of the variable
    will be on the following lines of each variable.

    The actual settings variables are those on the lines that do not start with a #

**************************************************************************************************************************/

# $RECIPIENT    : STRING - NEEDED VALUE
#
#               The email address the form should be sent to.
#
#               CAN SET AS HIDDEN FIELD if used for several forms with different recipent. */
#
# $RECIPIENT - Var to edit follows:

$RECIPIENT		= 'PUT_EMAIL_ADDRESS_HERE'; // The email address the form should be sent to.

# $ONSUCCESS   : STRING - NEEDED
#
#                Set $ONSUCCESS to the path_to and the thanks page used for successful submissions.
#                e.g. ./thanks.php
#                If this does not contain a value then a very basic default message will be used.
#
# $ONSUCCESS - Var to edit follows:

$ONSUCCESS		= 'thanks.php'; // The path to and thanks page for successful submissions, e.g. ./thanks.html, 

# $ACTSUCCESS   : NUMERIC - NOT NEEDED
#
#                Set $ACTSUCCESS to 1 to redirect to the include the $ONSUCCESS thanks page or to 0 to include it. This will 
#                default to * include_once() * the thanks page of not set. After the include_once() function, exit() will be called.
#
#                There is also the option to set this to 2 so the form page will just load again, even on success. E.g. If you use
#                the same page and just want to load a table that alerts your user to a success, then you can set this to 2 and use
#                the variable of $easiMail_success 'which will be set to true on success' as a flag to load the success table rather
#                than the form table.
#                
#                CAN SET AS HIDDEN FIELD if used for several forms with different thanks pages. */
#
# $ACTSUCCESS - Var to edit follows:

$ACTSUCCESS		= 0; // Set to 0 to include once, 1 to redirect to the thanks page or 2 to just load the form page again.

/***************************************************************************************************************************
*                                                       OPTIONAL SETTINGS
***************************************************************************************************************************/

# $REQUIRED     : STRING - NOT NEEDED
#
#               It would seem logical to have this set to at least: email,message on most forms if those 
#               fields are used, although easiForm will set the email by default even if not entered in this string
#               This means that a field name with the name of $f[email] must be used on your forms. If you wanted to make 
#               the $f[name] field a required field then you would set this to 'name' more than one value should be comma 
#               separated as 'message,comments' etc.
#               CAN SET AS HIDDEN FIELD. */
#
# $REQUIRED - Var to edit follows:

$REQUIRED		= ''; // A list of the required form fields, entered as: 'name,phone,message' etc.

# $SUBJECT      : STRING - NOT NEEDED
#
#               The email subject, this can be set as a hidden field on the form if using several forms within the same directory. 
#               That way each form can have a different subject. Will default to 'Web contact' if empty.
#               This value will be trimmed to a maximum of 70 chars.
#
#               CAN SET AS HIDDEN FIELD if used for several forms with different recipent.
#
# $SUBJECT - Var to edit follows:

$SUBJECT		= 'Web contact'; // The email subject, this can be set as a hidden field on the form if using several forms within the same directory.

# $FROMEMAIL    : STRING - NOT NEEDED
#
#               E-mail address the message is set to the user from, if different to $RECIPIENT. 
#               This is useful if an address of hide@address.com is needed.
#               Leave string empty to default to $RECIPIENT address.
#               Only used if $CONFIRM is set to true.
#                
#               CAN SET AS HIDDEN FIELD if needed when used for several forms.
#
# $FROMEMAIL - Var to edit follows:

$FROMEMAIL      = ''; // The email address the message is set to the user from, if different than $RECIPIENT

# $MAILOPEN     : STRING - NOT NEEDED
#
#               Type any text here you want the email message to open with.#
#               Do not remove the $eF_NewLine from the end of the line:
#               'The following message was received from the web:' . $eF_NewLine;
#
#               CAN SET AS HIDDEN FIELD.
#
# $MAILOPEN - Var to edit follows:

$MAILOPEN		= 'The following message was received from the web:' . $eF_NewLine;

# $CONFIRM      : BOOLEAN - NOT NEEDED
#
#               If $CONFIRM is set to true then a confirmation email will be sent to the users address.
#
#               CAN SET AS HIDDEN FIELD. */
#
# $CONFIRM - Var to edit follows:

$CONFIRM		= true; // Set to: true to send a confirmation to the sender, false to not.

# $TEXTWRAP     : STRING - NOT NEEDED
#
#               Fields that should have their text value word wrapped to 75 chars.
#               This could be used for message or comment fields where quite a bit of text might be returned 
#               and so making it easier to read. If you wanted to wordwarp the $f[message] field or text area then 
#               you would set this to 'message' more than one value should be comma separated as 'message,comments' etc.
#
#               CAN SET AS HIDDEN FIELD. */
#
# $TEXTWRAP - Var to edit follows:

$TEXTWRAP 		= ''; // These values will be word wrapped to 75 chars, entered as: 'message,comment' etc.

# $WRAPTO       : NUMERIC - NOT NEEDED
#
#               If not set between 30 and 74 then this will default to 75 and only be used if $TEXTWRAP contains any fields.
# 
#               CAN SET AS HIDDEN FIELD.
#
# $WRAPTO - Var to edit follows:

$WRAPTO         = 0;

# $NOTALLOWED     : STRING - NOT NEEDED
#
#               Add any words you do want to not allow in your form fields, for example you could use this to not permit
#               swear words or names of drugs. If you wanted to stop users from sending messages with the following 
#               words: viagra, drugs and cheap then the string for this variable would look as:
#               $NOTALLOWED = 'viagra,v1agra,cheap,drugs';
#
#               The values passed in the form would then be checked and not permitted if found to contain any of
#               those words used in the variable string.
#
#               No need to double up on words, the word 'viagra' will check for Viagra and VIAGRA also.
#
#               Note: If you use a word in the NOTALLOWED string, say as: 'viagra,v1agra,cheap,drugs' then any word containing
#               any of these words will not be permitted either, e.g. a message with cheaper will not be permitted. If the 
#               string is changed to adding a space before and after the word such as: 'viagra,v1agra, cheap ,drugs' then cheaper 
#               will be permitted but cheap will not.
#
#               CANNOT BE SET AS HIDDEN FIELD. */
#
# $NOTALLOWED - Var to edit follows:

$NOTALLOWED 	= ''; // Messages containing any of these words will not be permitted.

# $CONOPEN      : STRING - NOT NEEDED
#
#               Use $CONOPEN to add any text you want the confirmation email message to open with, only if $CONFIRM is 
#               set to true. A unique tracking number as in the example shown will only be used if $SETRAMDOM is set to 
#               a value.
#               This text uses the string: '[MESSAGECONTENT]' which will be replaced with: (Example as follows)
#               
#               This is an automated message, please do not reply.
#               Thank you, we will reply to your enquiry as soon as possible.
#
#               ------------------------------------------------
#				Subject: Web contact - [CM20461]
#				------------------------------------------------
#
#				Submitted: 2 Mar, 2007 at 11.13 pm
#
#				Name:	John Smith
#				Message: Hello, I am contacting you to see if
#				it where possible to....... etc.
#
#				------------------------------------------------
#               
#               # Do not modify the subject line of this email as the
#               subject line provides tracking data for this request.
#
#               CANNOT BE SET AS HIDDEN FIELD.
#
# $CONOPEN - Var to edit follows:

$CONOPEN		= 'This is an automated message, please do not reply.' . $eF_NewLine
				. 'Thank you, we will reply to your enquiry as soon as possible.' . $eF_NewLine
				. '[MESSAGECONTENT]' // This line will be replaced with the message data.
				. '# Do not modify the subject line of this email as the' . $eF_NewLine
				. 'subject line provides tracking data for this request.' . $eF_NewLine;

# $F_Web        : STRING - NOT NEEDED
#
#               The web page address used for any confimation email footer.
#               If used with several different forms and needs to be different then this
#               can be set as a hidden field in the form.
#                
#                CAN SET AS HIDDEN FIELD.
#
# $F_Web - Var to edit follows:

$F_Web			= 'http:www.DOMAIN.WHATEVER'; // Web address to use in the footer, this can be set in each form if different but change this setting here to: $F_Web = $F_Web;

# $F_Email      : STRING - NOT NEEDED
#
#               The email address used for any confirmation email footer.
#
#                CAN SET AS HIDDEN FIELD.
#
# $F_Email - Var to edit follows:

$F_Email		= 'hide@address.com'; // Mail address to use in the footer, this can be set in each form if different but change this setting here to: $F_Email = $F_Email;

# $F_line      : STRING - NOT NEEDED
#
#               Dotted lines on confirmation footer 'if used' and for $CONOPEN information.
#
#                CAN SET AS HIDDEN FIELD.
#
# $F_line - Var to edit follows:

$F_line         = '------------------------------------------------'; // Lines set in footer and in the $CONOPEN information.

# $FOOTER       :  STRING - NOT NEEDED
#
#               This is the footer added to any confirmation email if used.
#
#               It is best not to edit any of the variables, just edit the text strings such as 'Regards,', 'WEB' etc.
#                
#               CANNOT BE SET AS HIDDEN FIELD.
#
# $FOOTER - Var to edit follows:

$FOOTER			= $eF_NewLine . 'Regards,' . $eF_NewLine // Regards, can be changed if preferred.
				. 'Administration' . $eF_NewLine // Administration can be changed if preferred.
				. $F_line . $eF_NewLine // Do not alter this line
				. 'WEB: ' . $F_Web . $eF_NewLine // WEB: can be changed if preferred.
				. 'EMAIL: ' . $F_Email . $eF_NewLine . $eF_NewLine; // EMAIL: can be changed if preferred.

# $SETRAMDOM    : STRING - NOT NEEDED
#
#               Add a random reference to subject headers, will do nothing if left empty.
#               If this is set to WE then - [WE54672] will be added to the subject header.
#               This is handy for tracking emails. The '54672' would be a random number created for each email. 
#               The $SETRAMDOM variable value is limited to 5 characters and / or numbers.
#                
#                CAN SET AS HIDDEN FIELD.
#
# $SETRAMDOM - Var to edit follows:

$SETRAMDOM		= 'WC'; // Set a random subject tag, '' to not. E.g. 'WC' will set a random tag of [WC28746] - Only used if $CONFIRM is set to: true and $SETRAMDOM has a value.

# $BLOCKDOM     : NUMERIC - NEEDED
#
#               Used to control the email address used ny the form user.
#
#               Set to 0 Form user can use an email address that is the same as host domain.
#               Set to 1 Form user can't use an email address that is same as host domain. (Recommended)
#
#               Set to 1 (Recommended) if you only want to restrict to the actual host domain.
#               Just remember if you are testing your form make sure this is NOT set to 1 for testing if using an email address from the same domain.
#
#               CANNOT BE SET AS HIDDEN FIELD.
#
# $BLOCKDOM - Var to edit follows:

$BLOCKDOM		= 0;

# $BLOCK_HTML   : BOOLEAN - NOT NEEDED
#
#               This can be used to detact if someone is putting html code and links in the message.
#
#               Set this to 0 to allow users to send html code in message
#               Set this to 1 to block users from sending html code in messages (Recommended)
#               Set this to 2 to allow message but remove any html code
#                
#               CANNOT BE SET AS HIDDEN FIELD.
#
# $BLOCK_HTML - Var to edit follows:

$BLOCK_HTML     = 1;

# $USE_DS       : BOOLEAN - NOT NEEDED
#
#               If $USE_DS is set to true then the date and time will be added to any email messages, i.e.
#
#               Submitted: December 22, 2003 at GMT: 10.20pm
#                
#               CAN SET AS HIDDEN FIELD.
#
# $USE_DS - Var to edit follows:

$USE_DS         = false;

# $STZ          : STRING - NOT NEEDED
#
#               Use $STZ is set to the server time zone if the $USE_DS is used, i.e.
#
#               Submitted: December 22, 2003 at GMT: 10.20pm
#                
#               The above example shows GMT.
#                
#               CAN SET AS HIDDEN FIELD.
#
# $STZ - Var to edit follows:

$STZ		    = 'UTC';

# $BASICERR     : BOOLEAN - NEEDED
#
#               IF $BASICERR is set to true then the error variable $ef_errors will not return field error text, e.g.
#                
#               Please correct the errors:
#               The 'First name' field needs a value
#               The 'Surname' field needs a value
#               The 'Email' field needs a value
#                
#               would be shown as:
#                
#               Please correct the errors:
#                
#               Why use this, well say you have a field name $f['surname'] and 'surname' is set as a required value in 
#               $REQUIRED, but the user forgets to use the field, when they submit the form a variable value called 
#               $surname_err will return true, so your form could just show the 'Surname' field title in red text
#               by using the following line of code:
#                
#               if ($surname_err) { echo '<font color=red>Surname:</font>'; { else } echo 'Surname:'; }
#                
#               This is a preference to help accomodate different form designs.
#                
#               CAN SET AS HIDDEN FIELD if used for several forms with different needs.
#
# $BASICERR - Var to edit follows:

$BASICERR       = false; // Switch off text errors.		

# $EF_N         : BOOLEAN - NOT NEEDED
#
#               If $BASICERR is set to true you can also use $EF_N to place a number before each error, i.e.
#
#               1 The 'First name' field needs a value
#               2 The 'Surname' field needs a value
#               3 The 'Email' field needs a value
#
#               CAN SET AS HIDDEN FIELD if used for several forms with different needs. */
#                
# $EF_N - Var to edit follows:

$EF_N           = true; // Number before each easiForm error, i.e. 1,2,3,4,5 etc.

# $EF_N_S       : STRING - NOT NEEDED
#                
#               If $BASICERR is set to true you can also use $EF_N_S to place a char before each error, for example:
#
#               If the above $EF_N is set to true and the following $EF_N_S set to a '.' then errors will be returned as:
#                
#               1. The 'First name' field needs a value
#               2. The 'Surname' field needs a value
#               3. The 'Email' field needs a value
#                
#               or if $EF_N is set to false and $EF_N_S is set to '#'
#                
#               # The 'First name' field needs a value
#               # The 'Surname' field needs a value
#               # The 'Email' field needs a value  
#                
#               $EF_N_S will be trunicated to a maximum of 10 chars.
#                
#               CAN SET AS HIDDEN FIELD if used for several forms with different needs. */
#
# $EF_N_S - Var to edit follows:

$EF_N_S         = '#'; // Max 10 chars.

#   END OF GENERAL SETTINGS

/***************************************************************************************************************************
*                                                      ADDITIONAL VARIABLES
*                                                                -
*                                                       LANGUAGE VARIABLES
*
****************************************************************************************************************************
*
*   If you are using the easiForm on a form that is not in English then the default errors would be
*   returned in English. Below is a list of user interface error strings that you can alter to suit
*   the language of the form used with the easiForm script, just replace the string values below
*   with the text relative to the language of your form. 
*   Note: The text and square brackets for [FIELD] should be left unaltered, this will be replaced with
*   the actual field name you used. 
*   To use these strings then remove the # from the start of the variable line...
*   E.g if you wanted to change the #$FSTR['need_val'] variable value
*   to use with a form in Spanish then you would should alter the #$FSTR['need_val'] line as follows:

#$FSTR['need_val']      = 'The [FIELD] field needs a value';

    would become:

$FSTR['need_val']      = 'El campo de [FIELD] necesita un valor'; // Actual content here would probably be pink and not grey as shown.

*   Remember to remove the hash '#' from the start of the line to use it, e.g. 
*
*   #$FSTR['not_p'] = 'Not permitted'; would need to be changed as follows to be enabled...
*   $FSTR['not_p'] = 'Your new text here';
*
*   Tip: If using English and you want to use different text then you can also alter the variables as 
*   outlined above to suit your needs.
*
*   THESE VARIABLES ARE AS FOLLOWS:
***************************************************************************************************************************/

#$FSTR['not_p']         = 'Not permitted'; // Returned if someone tried to use the form for spam
#$FSTR['web_c'          = 'Web contact'; // 
#$FSTR['cor_err']       = 'Please correct the errors'; // Set in $ef_errors
#$FSTR['need_val']      = 'The [FIELD] field needs a value'; // Set in $ef_errors if $BASICERR = false
#$FSTR['bad_format']    = 'The [FIELD] format is not correct'; // Set in $ef_errors if $BASICERR = false
#$FSTR['not_perm']      = 'The attempted [FIELD] action is not permitted'; // Returned if used for spam
#$FSTR['email_diss']    = 'This email address is not permitted';
#$FSTR['subject']       = 'Subject'; // Message subject title text
#$FSTR['int_err']       = 'There was an internal error! your messsage was not sent'; // Internal error
#$FSTR['m_sent']        = 'Thank you, your form was sent'; // Back up text if a thanks page is not used
#$FSTR['at']            = 'at'; // date 'at' time (Set in messages set to you to record the date stamp)
#$FSTR['submitted']     = 'Submitted'; // Submitted: date at time
#$FSTR['content']       = 'Content'; // Word placed before message content data
#$FSTR['tags']          = 'HTML TAGS'; // Text to replace [FIELD] in $FSTR['not_perm'] if $BLOCK_HTML is set to 1
#$FSTR['words']         = 'Words'; // Text to replace [FIELD] in $FSTR['not_perm'] if $NOTPERMITTED is set.
#$FSTR['email']         = 'Email'; // Text to replace [FIELD] in $FSTR['not_perm'] if there is an email error.
?>
Return current item: easiForm