Contact Form PHP Script - contact.php by Mike Challis Free PHP Scripts - www.642weather.com/weather/scripts.php More Info - www.642weather.com/weather/scripts-contact-form.php Download - www.642weather.com/weather/scripts/contact-form.zip Contact Mike - www.642weather.com/weather/contact_us.php Version: 1.00 28-May-2008 Version: 1.01 29-May-2008 fixed session_start warning "headers already sent" Version: 1.02 30-May-2008 fixed "TRIM here" comment syntax Version: 1.03 07-Jun-2008 added config setting for printing $thank_you message after form is sent Version: 1.04 07-Jun-2008 To: [contact] (webmaster, member service, etc) is now printed in the email, fix contacts dropdown, if there is only one contact, no need to "Select" it, added setting for captch library [path]/[folder] Version: 1.05 09-Aug-2008 Spelling correction in $welcome_intro, also shortened it a bit. (no other code changes) Version: 1.06 10-Aug-2008 Now automatically adds numbered keys to the $contacts array for simpler contacts config changed page title to 'Contact Us' added version print tag into html source added error message if "captcha_library not found" added features by Kevin Reed at www.tnetweather.com: (Thanks Kevin) Added HTML code to Pass Section 508 and WAI accessibility validation Added meta tags (WAI Requirement) Added labels for form elements (WAI Requirement) Removed the table since is was not really needed. Added fieldset/legend Added CSS basics for the form to allow easier enhancement. The entire form is now controlled by the div id of contactform. Some other small changes. If upgrading to version 1.06 and are integrating into your website template... follow step 4 of the readme.txt and be sure to add the css and meta tags to your html section Version: 1.07 - 11-Aug-2008 added features: checks for required mail and image functions fixed bug with truncated string when double quote in name or subject input Better input string protection, new cleaner code input functions renamed all included subroutines with ctf_ prefix so they will not conflict with other scripts wordwrap email message text so lines are no longer than 70 characters added ini_set sendmail_from, needed for some windows servers this update is recommended for the bug fix and better security Version: 1.08 - 13-Aug-2008 added a few settings for email message headers few other small fixes Version: 1.09 - 13-Aug-2008 - Problem: Warning: mail(): Bad parameters to mail() function, mail not sent. - Solution: Removed '. PHP_EOL' from subject line. Version: 1.10 - 14-Aug-2008 small fix in function ctf_validate_email This update is not needed unless you were getting this error on send: Fatal error: Call to undefined function getmxrr() Version: 1.11 - 16-Aug-2008 added feature to have the same form used for a domain that also has aliases, without turning off domain checking http://www.weather-watch.com/smf/index.php/topic,33604.msg274348.html#msg274348 This update is not needed unless you need this feature Version: 1.12 - 20-Aug-2008 - how to add another field? You would have to edit 5 places places in the script. This update just adds a comment for each place in the code. see the readme.txt for more details Version: 1.13 - 25-Aug-2008 Fix for handling a blank HTTP_REFERER (a rare condition) in host name check when $domain_protect is enabled Version: 1.14 - 04-Sep-2008 - added feature: Optionally you can change the default mail SMTP settings - changed the display of input errors, each input error now displays exactly above the corresponding input field, the way it was before, the messages were all displayed in one bunch above the form. - added a input error for captcha field not filled in rather than just saying the captcha did not match. Version: 1.15 - 29-Sep-2008 - fixed Undefined variable warnings (only happenned if you had error warnings enabled) Version: 1.16 - 28-Oct-2008 - feature change - when you only have one email to contact, there is no drop down to select who to contact This update is not needed unless you need this feature Version: 1.17 - 21-Nov-2008 - added a setting: $email_on_this_domain normally this setting will be left blank, like this: $email_on_this_domain = ''; some web hosts do not allow your PHP to send email unless the From: email address is from the same domain. If your form does not seem to be sending any email, then set this to your email address on the SAME domain as your web site as a possible workaround Version: 1.18 - 25-Nov-2008 - couple of html validation fixes - form name changed to form id and there was a missing closing slash on input CID Version: 1.19 - 01-Jan-2009 - added ban by ip address feature Version: 1.20 - 19-Mar-2009 - fixed unclosed div after message sent - a few spelling corrections on code comments and displayed error codes Version: 1.21 - 27-Mar-2009 - added a optional "redirect to home page" feature Version: 1.22 - 27-Mar-2009 - added an optional Double E-mail entry setting. enabling this requires the user to enter their email two times on the contact form. Version: 1.23 - 11-Aug-2009 - added BCC(Blind Carbon Copy) email feature in settings Version: 1.24 - 27-Aug-2009 - fixed deprecated ereg_replace and eregi functions for PHP 5.3+ compatibility when error warnings are on Version: 1.25 - 29-Aug-2009 - Improved ctf_validate_email function and fixed a bug that invalidated email address with upper case (introduced in last version) Version: 1.26 - 01-Sep-2009 - Fixed email validation issue on some Windows servers.