Plug-ins: Forms & Data Collection

This plug-in can be accessed by any HTML form on any Zencil website. It will cause the form input to be e-mailed to the website owner or some other pre-defined recipient.

Steps

  1. Build a complete HTML form including form tags, inputs, and a submit button.
  2. In the form tag point the action attribute at http://www.thedomain.com/plugins/formmailer.php and set the method to post.
  3. Include the hidden fields below (don't forget to change the values in these fields).
  4. Paste the resulting page into the site throught the text editor.  (You may want to past the html into the source view of the text editor.)

Required Fields

<input type="hidden" name="email_dest" value="send_data_to@anywhere.com" />
<input type="hidden" name="email_source" value="email_address_field_name or anActual@address.com" />
<input type="hidden" name="email_name" value="Name of Form or Name of Site" />
<input type="hidden" name="email_greeting" value="This becomes the first line of the e-mail body." />
<input type="hidden" name="email_subject" value="Subject line of the e-mail" />
<input type="hidden" name="ignore_values" value="comma,separated,list,of,fields,to,ignore,when,emailing" />

Understanding the Process

First the script reads the hidden fields to find out:

  • where to send the data.
  • what e-mail address the data recipient can reply-to.
  • where the e-mail is from (what site, what form).

Next the script re-writes the data as an e-mail.

  • The format of the e-mail is field name: value entered
    It is good practice to use underscores instead of spaces in field_names.  These underscores will be replaced by spaces in the e-mail.
  • The script does not really do much else, but lists look kind of dumb when there is only one bullet point.

Sample HTML <FORM>

<form name="form1" action="http://www.somesite.com/plugins/formmailer.php" method="post">
<table class="null" cellspacing="0" cellpadding="3" width="100%" border="0">
<tbody>
<tr>
    <td><div align="right">First name:</div></td>
    <td><input id="fname" name="first_name" /></td>
</tr>
<tr>
    <td><div align="right">Last name:</div></td>
    <td><input id="lname" name="last_name" /></td>
</tr>
<tr>
    <td><p align="right">E-mail:</p></td>
    <td><input id="lname" name="email_address" /></td>
</tr>
<tr>
    <td><div align="right">Address:</div></td>
    <td><input id="address1" name="address_line_one" /></td>
</tr>
<tr>
    <td><div align="right">Address 2:</div></td>
    <td>
        <input id="address2" name="address_line_two" />
        <font size="-2">(optional)</font>
    </td>
</tr>
<tr>
    <td><div align="right">City:</div></td>
    <td><input id="city" name="city" /><font size="1">(optional)</font></td>
</tr>
<tr>
    <td><div align="right">Province:</div></td>
    <td><input id="prov" name="prov" /></td>
</tr>
<tr>
    <td><div align="right">Postal Code:</div></td>
    <td><input id="postal" name="postal_code" /><font size="1">(optional)</font></td>
</tr>
<tr>
    <td><div align="right">Phone:</div></td>
    <td><input id="phone" name="phone" /><font size="-2">(optional)</font></td>
</tr>
<tr>
<td colspan="2">
<div align="center">
    <input type="hidden" name="email_dest" value="fake@fake.com" />
    <input type="hidden" name="email_source" value="email_address" />
    <input type="hidden" name="email_name" value="Form Mailer" />

    <input type="hidden" name="email_subject" value="Information Submission" />
    <input type="hidden" name="email_greeting" value="Here is the information:" />
    <input type="hidden" name="ignore_values" value="submit" />
    <input type="submit" name="Submit" value="Submit" />
</div>
</td>
</tr>
</tbody>
</table>
</form>
 
    Copyright Clear Site Web Solutions Corporation  |  Victoria, B.C. Canada