Using Manic's FormCGI script

FormCGI takes form input and emails you or writes out to a file, or both. FormCGI is a more flexible replacement for our Mailform and Fileform scripts. Advanced options include required fields, and regular expression matching.
Advanced users may wish to skip to the complete list of form options.


Sample Form processor:

    Topping:
    Extra cheese?
    Destination email address:


    When the submit button is pressed (above), Manic's form.cgi script emails the form input (information about the topping and extra cheese) to the destination email address or writes out to a designated file (or both) . The destination email address can either be user-specified (as above), or hard-coded. You may also have this information written out to a file instead of being emailed.

    Try the form above! You should receive an email which looks something like this:

      Below is the result of your feedback form. It was submitted by Sample form (sample@manicdesign.com) on Sunday, July 6, 1997 at 01:59:57 ------------------ topping: Pepperoni extra_cheese: on ------------------ Date: Sun Jul 6 01:59:57 2000 IP: 204.210.0.22 Referrer: http://customers.manicdesign.com/free_cgi/formcgi.shtml Server: customers.manicdesign.com

    The code to produce the form above:

    <FONT SIZE=+1><B>Sample Form processor:</B></FONT><BR>
      <FORM METHOD=POST ACTION="/cgi-t/form.cgi">
      Destination email address: <INPUT TYPE=TEXT NAME=to><BR>
      <INPUT TYPE=HIDDEN NAME=from VALUE="sample@manicdesign.com">
      <HR SIZE=1>
      Topping: <SELECT NAME=topping>
         <OPTION> Pepperoni
         <OPTION> Mushroom
         <OPTION> Anchovies
      </SELECT><BR>
      Extra cheese? <INPUT TYPE=CHECKBOX NAME=extra_cheese><BR>
      <INPUT TYPE=HIDDEN NAME=realname VALUE="Sample form">
      <INPUT TYPE=SUBMIT VALUE="Submit this form!">
    <HR SIZE=1>
    </FORM>


Using FormCGI to email results:

    Using form.cgi is straightforward. Simply use the following code fragment, and build your form and HTML around it:

    <FORM METHOD=POST ACTION="/cgi-t/form.cgi">

      <INPUT TYPE=HIDDEN NAME=to VALUE="you@yourdomain.com">
      <INPUT TYPE=HIDDEN NAME=from VALUE="you@yourdomain.com">
      <INPUT TYPE=HIDDEN NAME=subject VALUE="My subject goes here">

       {place your form elements here}

      <INPUT TYPE=SUBMIT VALUE="Submit this form!">
    </FORM>

    You must specify "to" and "from" email addresses, replace "you@yourdomain.com" with your actual email address, and select any subject which you like to replace "My subject goes here".

Using FormCGI to write results to a file:

    Use the following code fragment if you want to have the results of your form written to a file instead of being emailed to you:

    <FORM METHOD=POST ACTION="/cgi-t/form.cgi">

      <input type=hidden name="filename" value="XXX">

       {place your form elements here}

      <INPUT TYPE=SUBMIT VALUE="Submit this form!">
    </FORM>

    Replace "XXX" with a name that you would like to use. The results will be written out to a file named "XXX.fileform.txt", this file will appear in your /cgi-out which is located up one directory from your /htdocs (default webroot) directory.

    If you would like to be notified when a submission has been placed in the file, add the following line:

    <input type=hidden name="notifyto" value="you@yourdomain.com">

    Replace "you@yourdomain.com" with your email address. You will then receive an email letting you know that you have a submission, however the actual data submitted will only be written to the file.

The above documentation should serve as an introduction to the form.cgi script, and provide you with enough information to setup and try out your first form. Once you've successfully done so, you'll probably want to view a complete list of mailform options or read about mailform's advanced options, including required fields, and regular expression matching.

Main | Signup | Hosting | Design | Webmaster Resources | Contact Us!




Copyright © 1996-2000, Manic Design
support@manicdesign.com