PC Services

 

Some PHP Tips and 'Tricks'

Thinking beyond each page and DESIGNING your web site

Tel: 0118 946 3634
Email

linked-in profile facebook profile

   The Company 
   Resources / Examples 
     Email Form Demonstration 
   Commentaries           
   Personal 

Example Contact Form Processing mini-site

For a good contact form processing example, we have a contact form to email PHP script set available as a zip file containing a mini-site (in its own directory), with different forms and email handling configurations, with results pages.

Installation is uncompress to a directory on a webserver, edit a few configuration items (like adding YOUR email address), then open the index page in the new directory.

Only real way to see how it works is to try it in a self-contained way before using for real, which can be done in demonstration mode a copy of the mini-site is accessible here.

Features of Form Processing Script

The following features for security and protection from spammers, have been assembled into the script set. Note not all security features are listed here of course.

  • Script callable from muiltiple forms.
  • Each form to have a config file, hidden from browsers.
  • Thank you pages, (defined in config file) to confirm email sent and/or data entered.
  • Email sent is formatted in order of fields configured, data is word wrapped and indented for easy reading
  • Error pages, (defined in config file)
  • Error page for invalid call to script (spammer or corrupted call).
  • Form to pass a coded alias for the email address to send details to (defined in config file).
  • All form values checked for valid data (stop unwanted side effects).
  • Size limit all form values for security (spammer doing direct post will bypass form). Important sizes and default max size defined in config file.
  • Select which special form fields have allowable email addresses (defined in config file).
  • Select which special form fields have allowable URL/web page addresses (defined in config file).
  • Extra checks for known web stuffing programmes, errors to drop forced web url insertions (99.99% spammers).
  • Only allow form POSTING from known website, IP addresses referrers defined in script.
  • Log as much detail as possible in the email sent to determine spammers and trouble makers that get through.
  • Allows for up to one attachment to be added by user, with a banned type list.

The contact form to email PHP script is available as a zip file containing a mini-site (in its own directory), with different forms and email handling configurations, with results pages. Default setup of the mini-site is in demonstration mode, so no emails are sent but the email messages are displayed on the results page.

To see this in action in a demonstration mode a copy of the mini-site is accessible here.

Please request this by contacting Paul Carpenter. Once you have used this we would like to hear back about your successes.

© 2010 onwards by PC Services, Reading UK Last Updated: 20th July 2013
If you encounter problems with this page please email your comments to webmaster