Free (as in beer) PHP Form Handler

Download invent_form_processor.zip

We've provided this form to mail handler in response to a specific request, but anybody is welcome to use it. All we would ask in return is that you credit us with a link to http://www.inventpartners.com from somewhere on your site. Perhaps on your form thankyou page?

This form processor takes GET and POST form submissions, and emails them to an email address hardcoded into the script - this makes it impossible for spammers to use this script to send spam by exploiting this script.

The script will validate required input fields, textareas and selects - however, it doesn't validate required checkboxes or radio buttons at the moment. It might do in a later version. Hey: it's free. Be grateful!

Configuration

Two main files you need to look at

Example form: index.php

There's an example form in the .zip file: index.html

If you want to make a field required, simply prefix its name with "req_" - for example:

<input type="text" name="name" /> - not required

<input type="text" name="req_name" /> - is required

There's also some quite neat form validation javascript (form_validation.js) included in the example. It's pretty handy - it uses the .formrequiredincomplete class in the included form.css file to highlight required fields in red when they aren't filled in.

form.php

Forms are submitted to form.php:

There's just four config elements you need to change here:

$form->processForm(
    'example.com' // Put you mail domain here
    ,
    'Invent Partners' // Put your site name / form name here
    ,
    'me@example.com' // Where will the form notification be sent?
    ,
    'forms@example.com' // This what the form FROM: address wil be,
    if the form submissions doesn't contain an email field
 
);

Please make sure you update these settings! Otherwise, we here at inventpartners.com will receive your form submissions. Much as we like you, we really don't have the time to forward them on to you.

"form/" directory

This contains the main form.class.php (don't mess with this unless you know your PHP), and bunch of includes: thankyou.inc.php is displayed upon a successful submission, error.inc.php when required fields aren't filled, and default.inc.php is displayed when the form processsor is "misfired"

Form Spam

Note: There's also some basic spam filtering functionality embedded into form.class.php - this isn't documented or implemented in this version, but if you want to start using it, a reasonably knowledgable PHP coder should be able to figure it out.

Legalese

Whilst we've made every effort to make this script both bomb and idiot proof, the usual disclaimers apply: Invent Partners accepts no liability for any loss or damages incurred by the use or misuse of this script. Sorry.

There. Now that's your lot. Download the script here - have fun!

“ Just wanted to send a quick 'thank you' to the Invent Partners team for all your help and support. I love the design of our new site and really appreciate the great service you provided at every stage - you turned a daunting project into one that I really enjoyed! Thanks again. ”
Lou, Advanced Writing Solutions

Contact Us

© 2024 Invent Partners Ltd | Supporters of FdA Web Design, Wakefield