Results 1 to 1 of 1

Thread: Sample filters

  1. #1
    Join Date
    Dec 2003

    Lightbulb Sample filters

    Attached to this post you'll find a ZIP package containing two sample filters for use with FormMail.

    These filters are written in PHP, so it's easy to modify them for your own use. These samples merely convert all the characters in the form submission to upper case.

    FormMail has two filtering mechanisms:
    1. It executes a program on the server to filter the data.
    2. It accesses a web URL that filters the data.
    The sample PHP filter for mechanism #1 is called "upperfiltercmd.php".
    The sample PHP filter for mechanism #2 is called "upperfilter.php".

    To use "upperfiltercmd.php", you would add this to your FormMail $FILTERS configuration:
    PHP Code:
    "toupper"=>"php upperfiltercmd.php" 
    Like this:
    PHP Code:
    $FILTERS = array("encode"=>"$REAL_DOCUMENT_ROOT/cgi-bin/fmencoder -kpubkey.txt",
    "toupper"=>"php upperfiltercmd.php"); 
    However, some servers won't run PHP scripts from the command line. If this is the case for you, then you'll need to use "upperfilter.php", which is designed to run on your web server.

    Add this to your FormMail's $SOCKET_FILTERS configuration:
    PHP Code:
    The above assumes you put "upperfilter.php" in your webserver's DOCUMENT ROOT. If you put it elsewhere, change "path" accordingly.

    Adding to the existing $SOCKET_FILTERS configuration looks like this:
    PHP Code:
    $SOCKET_FILTERS = array(
    Make sure you replace YourSiteHere with your site's domain name.

    To get your form to use a filter, simply add this hidden field to your form:
    <input type="hidden" name="filter" value="uppercase" />
    replacing "uppercase" with whatever filter you want to call.

    For more information about filter:

    Download Problems?

    If you can't download the attachment, it might be because of a bug in Microsoft Internet Explorer 7.

    In any case, you can use this alternate download location:
    Attached Files Attached Files
    Last edited by russellr; 21-Jul-2010 at 04:56 AM. Reason: Added alternate download
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Sample HTML Form Using FormMail
    By russellr in forum FormMail
    Replies: 1
    Last Post: 21-Mar-2007, 07:49 AM
  2. Using Filters, including FormMailEncoder
    By russellr in forum HOWTO Guides and Tips
    Replies: 0
    Last Post: 15-Oct-2004, 08:51 AM
  3. Sample Auto Responder Form & Template
    By russellr in forum FormMail
    Replies: 0
    Last Post: 04-Sep-2004, 11:15 PM
  4. Good Template - a sample for you to use
    By russellr in forum FormMail
    Replies: 0
    Last Post: 31-Aug-2004, 05:05 AM
  5. Error template - a sample for you to use
    By russellr in forum FormMail
    Replies: 0
    Last Post: 18-May-2004, 04:38 AM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts