Mail Form

Adding a guestbook is easier than this script. If you have never worked with forms before, try adding a Guestbook to your page before you try utilizing this script.

First, you need to make a form which POSTS or submits to '/cgi-bin/email_form.pl'. You need to name each field a unique name. Name them all as lower-case, space-free words. A couple of 'HIDDEN' fields need to be presena, as well:
<form action="/cgi-bin/email_form.pl" method=post> <input type="hidden" name="template" value="/www/www.freshartnyc.org/data/mailing.template"> <input type="hidden" name="redirect" value="http://www.freshartnyc.org/mailing_thanks.html">
The template field is the file which is emailed to you. Before it is emailed, all the values the user enters into the form will be pushed into VARIABLES in the template. After all is done, the user will be redirected to the value of the 'redirect' field. The fields names are case-sensitive (use lower case!). Here are a couple of sample uses of this script:

  • www.freshartnyc.org's Mailing list signup
  • www.monkeybrains.net's sign-up form

  • Here is a sample template:
    From: FreshArtNYC Site <nobody@monkeybrains.net> To: your_email@freshartnyc.org Subject: Add me to the mailing list! Some one filled out the mailing list form on the freshartnyc.org site! Here is the info I recorded for you: $first $last $email $street $city $state $zip $country
    And corresponding form:
    <form action="/cgi-bin/email_form.pl" method=post> <input type="hidden" name="template" value="/www/www.freshartnyc.org/data/mailing.template"> <input type="hidden" name="redirect" value="http://www.freshartnyc.org/mailing_thanks.html"> First Name: <br> <input type=text name=first maxlength="20"> <p> Last Name: <br> <input type=text name=last maxlength="20"> <p><b><font size="3" color="#66CCFF">To receive notices by email, please enter your email address:</b> <p>Email: <br> <input type=text name=email maxlength="100" size="40"> <p><b>To receive notices by snail mail, please fill out the below:</b> <p>Street Address: <br> <input type=text name=street size="70"> <p>City: <br> <input type=text name=city size="50"> <p>State: <br> <input type=text name=state size="5"> <p>Zip: <br> <input type=text name=zip> <p>Country: <br> <input type=text name=country size="50"> <p> <input type="submit" value="Send Info" name="submit"> <div> </div> </form>
    Which looks like this:
    First Name:

    Last Name:

    To receive notices by email, please enter your email address:

    Email:

    To receive notices by snail mail, please fill out the below:

    Street Address:

    City:

    State:

    Zip:

    Country:


    Return to Support section of MonkeyBrains.net