Weather-Watch.com
September 02, 2010, 05:26:53 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Members: 8,509  Posts: 362,030  Topics: 40,113
Please welcome lawrencerebeiro, our newest member.

Latest versions: WD - 10.37P  WDL - 6.05  MML - 1.03
 News:
Check out the new FAQs (Frequently Asked Questions) board for a growing list of hints, tips and diagnostic suggestions.
  Advanced Search
   Home   Bug Tracker Photo Gallery Wiki Chat Calendar Search Login Register Help  
Pages: [1] 2 3 ... 14
  Print  |  « previous  |  next »  |  Go Down  
Author Topic: Free Contact Form PHP Script with image captcha - contact.php  (Read 28445 times)
0 Members and 1 Guest are viewing this topic.
MCHALLIS
Rain Maker
***
Offline Offline

Location: Long Beach, WA USA
Station Type: Davis VP2+
Posts: 1,997
Local Time: Thursday 11:26



WWW
« on: August 08, 2008, 04:23:53 PM »

I made a Free Contact Form PHP Script with image captcha - contact.php
It includes a captcha with audio and a refresh feature.

You can see my contact form here
http://www.642weather.com/weather/contact_us.php

Features:
Tested code (has been running on several sites for several months with no problems)
XHTML Transitional compliant
Reloads form data and warns user if user forgets to fill out a field.
No need to press back button.
Optional redirect to home page after message sent
Validates syntax of email address (user@aol = bad, user@aol.com = good)
Use as a standalone page or incorporate into your site template
It can run on most any webserver as long as you have PHP installed, and GD support within PHP.
(see readme.txt inside the zip for full instructions)

Security:
It has very tight security, it stops all the spammer tricks I have found.
Filters all form inputs from html and other nasties.
Spamchecks email address input from common spammer tactics...
 prevents spammer forcing to:, cc:, bcc:, newlines, and other email injection attempts to spam the world
Make sure the form was posted from your approved host name only. (enable or disable with a setting)
E-mail message shows IP address and user agent (browser version) of user who contacted you

Captcha Image by www.phpcaptcha.org included (enable or disable with a setting)
# open-source free PHP CAPTCHA script
# Abstract background with multi colored, angled, and transparent text
# Arched lines through text
# Generates audible CAPTCHA files in wav format
# refresh button to reload captcha if you cannot read it.

Version: 1.4 - 28-Jan-2010 - Added setting to enable or disable form fieldset border.
- Simplified blank field messages (and removed the word "error" from them).
- Text labels changes: 'E-Mail' change to 'Email', 'e-mail' changed to 'email'.
- CAPTCHA function can now report server cookie problems.

Version: 1.3 - 21-Nov-2009 - Compatible with SecureImage CAPTCHA library version 2.0
Be sure to also upgrade to SecureImage Library version 2
To upgrade the library: delete your old /captcha-secureimage/ library folder and replace with this new one:

Download the library here:
http://www.642weather.com/weather/scripts/captcha-secureimage.zip
note: the old library would still work, except it is less secure and has less features.

New CAPTCHA features include: increased CAPTCHA difficulty using mathematical distortion, streaming MP3 audio of CAPTCHA code using Flash, random audio  distortion, better distortion lines, random backgrounds and more.
- New contact form option $enable_captcha_audio_flash enables streaming MP3 audio of CAPTCHA code using Flash

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.24 - 27-Aug-2009
- fixed deprecated ereg_replace and eregi functions for PHP 5.3+ compatibility when error warnings are on

Version: 1.23 - 11-Aug-2009
- added BCC(Blind Carbon Copy) email feature in settings

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.21 - 27-Mar-2009
- added a optional "redirect to home page" feature (upload the ctf-loading.gif and contact.php, then look for the new settings to enable inside contact..php)

Version: 1.20 - 19-Mar-2009
- fixed unclosed div after message sent
- a few spelling corrections for code comments and displayed error codes

Download links:
Required library:(this has to also be installed)
http://www.642weather.com/weather/scripts/captcha-secureimage.zip

Contact Form (see readme.txt inside the zip for full instructions):
http://www.642weather.com/weather/scripts/contact-form.zip

I now offer a special plugin version just for the Weather Display/PHP/AJAX Website USA Template Set
It is exactly the same contact form as my contact.php except this version it is inside a template page called wxcontact.php
wxcontact.php Contact Form (see readme.txt inside the zip for full instructions):
http://www.642weather.com/weather/scripts/wxcontact-form.zip

It is only English language at this time (it does not have any multi language features)

Here is a sample contact email message: (my real ip has been masked for this post)
------------------------

Sent from Long Beach Weather contact form

To: Webmaster

From:
Mike Test
mike@somewebsite.com

Message:
This is a test to show what the email message looks like

Sent from (ip address): 68.118.xxx.xxx (68-118-xxx-xxx.dhcp.xxx.xxx.charter.com)
Coming from (referer): http://www.642weather.com/weather/contact_us.php
Using (user agent): Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0
« Last Edit: January 28, 2010, 05:27:31 PM by MCHALLIS » Logged

Budgie
Martin
Junior Weather Controller
****
Offline Offline

Location: Isle of Lewis, Scotland
Station Type: Davis VP2 with Solar, UV & FARS, Boltek PCI, Nexstorm, Logitech Pro5000 & WXSim
Posts: 3,475
Local Time: Thursday 18:26


MML Station: WD00934 CWOP: CW7959


WWW
« Reply #1 on: August 08, 2008, 04:57:10 PM »

Thanks for reminding me Mike, I've been meaning to add this to my own site after running it on SCWN since that started.
A highly recommended addition to your site folks!!  Very Happy

Edit: All up & running on both my weather & photos sites.  thumbright
« Last Edit: August 08, 2008, 07:41:41 PM by Budgie » Logged

drobbins
Rain Maker
***
Offline Offline

Location: Kentucky, USA
Station Type: Davis Vantage PRO2
Posts: 1,213
Local Time: Thursday 11:26



WWW
« Reply #2 on: August 08, 2008, 08:59:04 PM »

WOW  - That was easy!
Logged

MCHALLIS
Rain Maker
***
Offline Offline

Location: Long Beach, WA USA
Station Type: Davis VP2+
Posts: 1,997
Local Time: Thursday 11:26



WWW
« Reply #3 on: August 09, 2008, 02:46:37 PM »

Did you know that spambots crawl over websites looking for email addresses, when they find one they add it to their database for junk email?

Problem:
If you publish your email on your web site, like in this example....
<a href="mailto:you@somewebsite.com" title="E-mail us">Contact Us</a>
... then your email will most definitely start getting lots of spam.
It is foolish to have your email address 'in plain site' on your websites, because harvesting them is one of the biggest ways that spammers get huge lists of email addresses to spam.

Solution:
Use my contact.php form so that your email address is completely concealed.

Another solution (although not as foolproof):
Use JavaScript to encrypt and hide your address from spam-bots.
http://www.dynamicdrive.com/emailriddler/
Logged

MCHALLIS
Rain Maker
***
Offline Offline

Location: Long Beach, WA USA
Station Type: Davis VP2+
Posts: 1,997
Local Time: Thursday 11:26



WWW
« Reply #4 on: August 09, 2008, 03:30:59 PM »

Current Version: 1.05  09-Aug-2008 Spelling correction in $welcome_intro, also shortened it a bit. (no other code changes)
Thanks niko  Smile
Logged

SandhurstWX
Ian
Senior Forecaster
*
Offline Offline

Location: Royal County of Berkshire, UK
Station Type: WMR928NX
Posts: 341
Local Time: Thursday 18:26


Another satisfied WD user!


WWW
« Reply #5 on: August 10, 2008, 12:43:57 PM »

Mike,
What a useful script, and swiftly incorporated into my site. Many thanks to you and all who keep on coming up with all these useful scripts. Very Happy
Logged

NorCal Dan
-= Dan =-
Senior Weather Controller
*
Offline Offline

Location: Where the RV is parked <> Elkton Oregon <> iWD on iMac
Station Type: WMR-100
Posts: 8,381
Local Time: Thursday 13:26



WWW
« Reply #6 on: August 10, 2008, 02:46:41 PM »

Mike,
What a useful script, and swiftly incorporated into my site. Many thanks to you and all who keep on coming up with all these useful scripts. Very Happy


Yes, very nice and easy to incorporate.  Thanks.
Logged

kray1000
Senior Forecaster
*
Offline Offline

Location: Roanoke, VA (USA)
Station Type: Davis Vantage Pro 2 Wireless
Posts: 248
Local Time: Thursday 12:26



WWW
« Reply #7 on: August 10, 2008, 04:01:42 PM »

Working very nicely here as well.  Thanks, Mike. thumbright

P.S. -- Love the CAPS "decapitator"!  Wink
Logged

Kevin Ray

Wireless VP2, Stardot NetCam, ImageSalsa 2.0.12, MovieSalsa, Nexstorm, WASP2, Skymet, VWS, WD 10.37Nb03
MCHALLIS
Rain Maker
***
Offline Offline

Location: Long Beach, WA USA
Station Type: Davis VP2+
Posts: 1,997
Local Time: Thursday 11:26



WWW
« Reply #8 on: August 10, 2008, 11:44:02 PM »

Updated today - 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 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 <head></head> section
« Last Edit: August 10, 2008, 11:53:57 PM by MCHALLIS » Logged

daveq
Junior Weather Controller
****
Offline Offline

Location: Hollywood, MD
Station Type: Davis VP2 w/FARS
Posts: 3,097
Local Time: Thursday 13:26



WWW
« Reply #9 on: August 10, 2008, 11:45:12 PM »

Mike, works very well and easy to set up.  I linked mine from the footer 'Contact Us' instead of adding a button.  You guys never cease to amaze me.

Thanks.

--Dave

Yikes.  New version as I was typing.
Logged
far_ken_beauty
Portland Bay Weather
Senior Forecaster
*
Offline Offline

Location: Portland, Victoria, Australia
Station Type: DAVIS VP
Posts: 464
Local Time: Friday 04:26



WWW
« Reply #10 on: August 11, 2008, 12:47:01 AM »

Yep. will be adding this. Well done.  Very Happy
Logged

MCHALLIS
Rain Maker
***
Offline Offline

Location: Long Beach, WA USA
Station Type: Davis VP2+
Posts: 1,997
Local Time: Thursday 11:26



WWW
« Reply #11 on: August 12, 2008, 04:55:49 AM »

Updated today...
Current Version: Version: 1.07 - 11-Aug-2008 added features: checks for required mail and image PHP 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
If upgrading to version 1.06 or higher 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 <head></head> section
Logged

MCHALLIS
Rain Maker
***
Offline Offline

Location: Long Beach, WA USA
Station Type: Davis VP2+
Posts: 1,997
Local Time: Thursday 11:26



WWW
« Reply #12 on: August 14, 2008, 02:01:42 AM »

Version: 1.08 - 13-Aug-2008
added a few settings for email message headers
few other small fixes
Logged

NorCal Dan
-= Dan =-
Senior Weather Controller
*
Offline Offline

Location: Where the RV is parked <> Elkton Oregon <> iWD on iMac
Station Type: WMR-100
Posts: 8,381
Local Time: Thursday 13:26



WWW
« Reply #13 on: August 14, 2008, 02:32:42 AM »

I don't see the subject in the email I sent myself...I must have something setup wrong as none of my previous emails had the subject line in them...
Logged

dafuser
Weather Guru
**
Offline Offline

Location: Granbury, Texas
Station Type: Davis Vantage Vue
Posts: 529
Local Time: Thursday 21:26



WWW
« Reply #14 on: August 14, 2008, 02:54:10 AM »

I'm getting the following error when I test the contact.php script:

Warning: mail(): Bad parameters to mail() function, mail not sent. in /home/content/d/a/f/dafuser/html/wx/contact.php on line 394

Message Sent

Your message has been sent, thank you.

I'm guessing I have some part of the configuration wrong, but don't see what it is.
Logged

--
Thanks Les...
Microsoft Windows: Proof that P.T. Barnum was correct.

24 inch iMac 2.8GHz C2D, 4 GB Ram (OS X 10.6.3 Snow Leopard) Davis Vantage Vue
Pages: [1] 2 3 ... 14
  Print  |  « previous  |  next »  |  Go Up  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!