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!
Two main files you need to look at
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.
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.
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"
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.
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!
© 2024 Invent Partners Ltd | Supporters of FdA Web Design, Wakefield