CW3 Form Mail
--------------
Important
===============================================================================================
You Must have Allow URL Fopen set to on in PHP. Example: allow_url_fopen = On
You should be able to set this in your hosting control panel or just locate the file php.ini and add the line in the example.
If you are the script in the contact foler you may also need to add additional settings to php.ini in the that folder
For SSL we use <form action="https:// as all sites today use this.
If your does not have an SSL then change the form to <form action="http://
Also in the index.php or contact.php file on line 173 where it shows header ("location: https://" change http:// to http://
================================================================================================


This script can be used to recieve emails from users visiting your website.
This script will filter out spam abuse which can get you black listed.
By method of a setting it can email you the IP address of the Spam attempt.

It can also be used as an internal email where one would want to have people fill out forms.
For such a purpose the forms would be sent to a email address within the company from another email address in the same company.
For example you may want to have workers or people applying for a job to fill out a form which would be sent to the person in charge of reviewing it.

All other inputs added will be sent to you as Form Name : value entered within the mail message.
They will appear after all the other items in the given form.

Customizing the forms
----------------------
Choose the form from the four given to modify.
If you choose to add inputs to the form they will also work without any other changes.
Just add them to the mail_form PHP file but be careful not to change any of the PHP code.

Which mail form should I use?
------------------------------
There are 4 different ones which are as follows:
mail_form_plain.php -- This one is a plain mail form with no header or footer. It can be used in a iFrame
mail_form_plain_hdr.php -- This one has both a header and footer.

mail_form_attach.php -- This one is a plain mail form which has a file attach elemment and it has no header or footer. It can also be used in a iFrame
mail_form_attach_hdr.php -- This one has both a header and footer and also has the file attach feature.

Whether to use the Root or Contact files
-----------------------------------------
We provide two sets of files in two folders.
The folder named root has the file name for the script as contact.php
This can be used in your public root folder of your hosting account.

The files within the contact folder can be copied to a folder in your public root named contact.

Really there is no difference between the two as the only difference is the name of the script file is changed for each version.
The script file can be renamed to anything but you would need to change the form action="" to the new name given to it.

Just copy the following files to your website to a location you prefer.

In your main root folder:

Copy all files from the root folder to you website.

In a folder named contact:

Copy the contact folder to your website.

If you want to send a auto responce to the user change $auto_respond = false; to $auto_respond = ture; in the contact.conf file and edit auto_res.txt to add your message.

If you wish to not use the header and footer files chenge the setting in the config file to false and use the form without the _hdr in it's name.

If you wish to place the form in a page you have then use a Iframe use the plain form with no headers and do this.
Example: <iframe style="width: 722px; height: 352px" src="/mail/contact.php" frameborder="0" align="center"></iframe>

We found that using an iFrame works best if you choose to just place the form on your page.
If you just place the form on your page without using an iframe the refresh may not work when a person clicks go back.
This will cause problems with the Captcha question as it will not refresh to match the new generated alpha numeric code.


The script can be used as your contact page when using the header / footer files or you can just include a form in your current contact page.
There are four form files and the one used is depending on your settings in the config file.
There are two plain form files, one each for header or non-header and also two file attach forms again with or without headers.
So if you choose to have attach files and no header then the form it will use is mail_form_attach.php.
You can modify it as needed.

contact.conf
contact.php
mail_form_plain.php or mail_form_plain_hdr.php -- depending on if you wish to use just a form or use the app as your page.

return_page.php
auto_res.txt
footer.html --- Not required if you choose to use only the form
header.html --- Not required if you choose to use only the form
mail_form_attach.php or mail_form_attach_hdr.php -- depending on if you wish to use just a form or use the app as your page.
image.php
JAi_____.TTF -- the true type font used for the image generator and mush be copied to the same folder as the other files.

mail_form_attach.php will be used if you activate the attachment ability in the contact.conf

If you placed the files in a sub directory to avoid search engines picking up your config file add a line to your robots.txt file to exclude the indexing of files in this directory.

You can rename contact.php or index.php to another name but it will require to also alter the form line action="contact.php" - be careful not to wreck the php code!
Info for robots.txt should you not know what it is will be also found on NetBizCity. --> http://netbizcity.com/MetaTagTips/tabid/60/Default.aspx

Edit the conf file and change the entries to reflect your website.

Set the domain name without the www as: mydomain.com
Set your email address
Other setting are not required but you can customize the form using them.
Settings such as setting headers on of off or allowing file attachments and the types of files to allow.
Most are explained within the conf file.

To use the Graphic user Verify you must have PHP with GD and FreeType installed.
You must copy the truetype font JAi_____.TTF to your website directory where the script was install.

After this is done test it to be sure it works properly.
Main script is contact.php all other files are called from it.
Just create a link to contact.php and you are done.

If you have problems with the image try loading image.php in your browser to see if there are errors.

To add form inputs use a three column table row where the second column spans two such as:

<tr><td>This is your description</td><td colspan=2>You input goes here</td></tr>

The script will work with as many coluns as you need to add.

If you wish to have an email sent you when an abuse takes place set $notify_abuse=true;

The script is free to use but if you need support then a minimum charge will be required of $10.00.

Since the script has changed dramatically we are not including prior changes from version 1.00

You can rename the files as you wish but the return page is hard coded in the script.
All files can be placed in a sub folder but you may need to edit the mail form to adjust the subfolder name.
The return page may require it be in the same location as your main contact page.

Setting of the form remembering what the user typed is quite easy if you add fields.
Added to the application are functions to reset the values the user typed.
The functions set_orig_value() and set_orig_checkbox() can be used to set the values back when a user hits the back link.
The use is as follows:

If you create a input box named phone_number then use  the function set_original_value as <?php set_orig_value('phone_number') ?> - single quotes!!
The forms are using this function and this is how one looks: 

<input type="text" size="35" name="name" value="<?php set_orig_value('name') ?>">

For check boxes use the set_orig_checkbox() function.

This saves a user time if he or she makes a mistake in filling out your form 
and has to go back to make a change as all imputs will have the info he or she last typed.




CW3 Mail Form Version 4.10
--------------------------
Version 4.10
Repaired bugs
Fixed internal mail feature

Version 4.00
Added security fix to script
Restructured code
Fixed add on columns to display proper in an email


Version 3.40
Fixed return page error with Apache 2 and PHP 5.3.1

Version 3.30
Added settings to choose file types allowed
Added setting for use of headers

version 3.00
Added ability to set required to any input added to form.
Added functions to re-populate form fields.
Added file upload / file email ability

version 2.01
Removed checking for domain name.
Since we added the new code to generate a key value this was no longer needed.
Made minor adjustments to form to make it more clear as to where added inputs can be placed for custom forms.
Version 2.02
Fixed a problem for windows path error.
Fixed a PHP image problem which caused an error on some servers not using latest version of GD lib. 

Version 2.02
Changes to server calls and POST Vars to support PHP 5


NetBizCity
http://www.netbizcity.com

CW3 Web Hosting
info@cw3host.com

Vincent G.