www.xenoplanet.com    
 x e n o p l a n e t dot com  v2.12 
  :: high speed webhosting :: domain registration :: e-commerce ::  
| Overview | Web Hosting | E-Commerce | Domain Registration | Support Center | Policies | Web Account | Contact | Company |
Sorry, your browser doesn't support Java(tm).
Miscellaneous
FAQs
Web Hosting
eMail Services
Multimedia
E-Commerce & Secure Server
CGI & Database
CGI Bundled Scripts
Domain Registration

[ o n l i n e   r e s o u r c e s ]

 

Xenoplanet's FormCGI - tutorial

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

Sample Form processor:

    Sample Form
    Information requested:
    Do you want to subscribe? mailing list
    Destination eMail address:
     

    When the submit button is pressed, Xenoplanet's form.cgi script emails the form input (the information requested and the mailing list subscription yes/no) 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! It is only a test form, you will just receive an eMail which looks something like this:

    Below is the result of your feedback form. It was submitted by
    Sample CGI Form (sample@xenoplanet.com) on Monday, May 7, 2001 at 14:55:56
    ---------------------------------------------------------------------------
    services: web hosting
    subscribe: on
    submit: :: submit this form ::
    ---------------------------------------------------------------------------
    Date: Mon May 7 14:55:56 2001
    IP: 62.158.49.72
    Referrer: http://www.xenoplanet.com/support/form_cgi.shtml
    Server: www.xenoplanet.com

    The code to produce the form above:

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

      Information requested:
      <SELECT NAME="services">
         <OPTION VALUE="web hosting">Web Hosting</OPTION>
         <OPTION VALUE="web design">Web Design</OPTION>
         <OPTION VALUE="e-commerce">E-Commerce</OPTION>
         <OPTION VALUE="domain registration">Domain Registration</OPTION>
      </SELECT><BR>

      Do you want to subscribe?
      <INPUT TYPE="checkbox" NAME="subscribe"><BR>
      <INPUT TYPE="hidden" NAME="realname" VALUE="Sample Form">
      
      Destination eMail address:
      <INPUT TYPE="text" NAME="to"><BR>
      <INPUT TYPE="hidden" NAME="from" VALUE="sample@xenoplanet.com">
      <INPUT TYPE="submit" VALUE="submit this form">

    </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 ACTION="/cgi-t/form.cgi" METHOD="post">

      <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 ACTION="/cgi-t/form.cgi" METHOD="post">

      <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.

Using FormCGI with SSL (secure server):

    You can also use FormCGI with secure server, to do this change the form action from the examples above to...

    <FORM ACTION="https://wwwXX.xenoplanet.com/yourdomain.com/cgi-t/form.cgi" METHOD="post">

    Replace XX with your server number (request this information sending an email to suppor@xenoplanet.com). Also replace yourdomain.com with your own domain name. To find out more about using SSL (secure server) with your account visit our Secure Server Guide.

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 FormCGI's advanced options, including required fields, regular expression matching, and credit card verification.

top of page

   
 :: © 2000-2005 xenomorph [michele gaggia] - all rights reserved - designed by  x e n o s t y l e 
 :: :: :: www.xenoplanet.com 
 200px  350px  200px