Results 1 to 1 of 1

Thread: Sample filters

  1. #1
    Join Date
    Dec 2003
    Posts
    3,980

    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",
        
    "null"=>"null",
        
    "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:
         "uppercase"=>array("site"=>"YourSiteHere",
             
    "port"=>80,
             
    "path"=>"/upperfilter.php",
             
    "params"=>array()), 
    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(
         
    "httpencode"=>array("site"=>"YourSiteHere",
         
    "port"=>80,
         
    "path"=>"/cgi-bin/fmencoder",
         
    "params"=>array(array("name"=>"key",
         
    "file"=>"$REAL_DOCUMENT_ROOT/cgi-bin/pubkey.txt"))),
     
         
    "sslencode"=>array("site"=>"ssl://YourSecureSiteHere",
         
    "port"=>443,
         
    "path"=>"/cgi-bin/fmencoder",
         
    "params"=>array(array("name"=>"key",
         
    "file"=>"$REAL_DOCUMENT_ROOT/cgi-bin/pubkey.txt"))),
     
         
    "uppercase"=>array("site"=>"YourSiteHere",
         
    "port"=>80,
         
    "path"=>"/upperfilter.php",
         
    "params"=>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:
    Code:
    <input type="hidden" name="filter" value="uppercase" />
    replacing "uppercase" with whatever filter you want to call.

    For more information about filter: http://www.tectite.com/fmhowto/filters.php

    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:
    www.tectite.com/public_downloads
    Attached Files Attached Files
    Last edited by russellr; 21-Jul-2010 at 03:56 AM. Reason: Added alternate download
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

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, 06:49 AM
  2. Using Filters, including FormMailEncoder
    By russellr in forum HOWTO Guides and Tips
    Replies: 0
    Last Post: 15-Oct-2004, 07:51 AM
  3. Sample Auto Responder Form & Template
    By russellr in forum FormMail
    Replies: 0
    Last Post: 04-Sep-2004, 10:15 PM
  4. Good Template - a sample for you to use
    By russellr in forum FormMail
    Replies: 0
    Last Post: 31-Aug-2004, 04:05 AM
  5. Error template - a sample for you to use
    By russellr in forum FormMail
    Replies: 0
    Last Post: 18-May-2004, 03:38 AM

Bookmarks

Posting Permissions

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