Genform - generic web form to email by Glyn Wadbrook April 2004 v1.1
contents
--------
overview
requirements
quick start instructions and installation
example of email
future enhancements
freeware
files
description of hidden fields for customisation
notes for advanced users
---------------------------------------------------------------------
Overview: Simple solution to generating a form - to - email page
Requirements:
website must run on a server supporting php 4
basic knowledge of html forms
no knowledge of php needed
no knowledge of javascript needed
Quick start instructions and installation:
unzip genform.zip into a folder
1. create your own form page layout using html or your favorite webpage editor (you can have other forms on your page)
2. copy the file genform.php to the same folder as your formpage
3. copy and paste all the code in genformbody.html anywhere into the body of your webpage
4. add your own input fields in the form
5. edit the hidden fields at the bottom of the genform for your requirements
(i.e. specifying email address, confirmation page (redirect), compulsory fields etc...)
6. create a 'redirect' page that will appear after email has been sent, or edit and use the supplied emailsent.html
7. That's it !
Example of email recieved after form submission:
name :
glyn
-----------------------------------------------------------------------------------
email :
klaatu_barada_nicto@yahoo.com
-----------------------------------------------------------------------------------
message :
my message
-----------------------------------------------------------------------------------
rating :
good
-----------------------------------------------------------------------------------
comments :
more comments
-----------------------------------------------------------------------------------
future enhancements:
next version will have more field validation - i.e. format of email fields etc..
freeware:
this version (v1.0) of this software (genform) is free and comes 'as is' with no warranty or support
files:
readme.txt - this file
genformtop.php - required php script file that is included into the web page using require('genformtop.php'); ?>
genformbody.html - html code snippet to be copied and pasted into web page, contains html and javascript
generic_form_example.html - example that appears on the website glynwadbrook.com/genform
emailsent.html - example of webpage 'redirect' confirming email sent
description of hidden fields for customisation:
----------------------------------------------
specifies fields in form (comma separated) that are required (not allowed to be blank)
specifies fields in form (comma separated) that will not be reported in email
specifies fields in form (comma separated) that will be validated for a correct email address format
specifies fields in form (comma separated) that will be validated for a correct date format (dd/mm/yyyy)
specifies webpage to go to after email has been sent
specifies 'to' email
------------------------------------------------------------------------------------
***** see notes on hiding your email address in hiding your email section below *******
----------------------------------------------------------------------------------
specifies 'from' email that will appear in the 'from' field in email client
specifies subject that will appear in email
specifies that empty (blank) fields will not be reported in email if this is set to 'true'
hiding your email from spammers!!
1. change the emailTo hidden field to be blank i.e:
2. edit the first line of genfrom.php, and put your email address in line 1
i.e. insert your email inbetween the ' ' marks in
$put_your_email_here='my@email.com';
save these files, upload to your server and your email address need not appear on your website.
notes for advanced users
------------------------
advanced users who understand php can edit genform.php for more customisation
advanced users who understand javascript can edit genformbody.html for more customisation (field validation)