Impulse Internet Services - Serving the California Central Coast since 1995
HomeAbout UsBusiness ServicesResidential ServicesCustomer SupportNetwork Information
.
.
.
  Support
.
 Overview
.
.
.
 Impulse FAQ
.
.
.
 Terms of Service
.
.
.
 Billing Policies
.
.
.
 ClearStar Support
.
.
.
 Dial-Up Numbers
.
.
.
 Configuration Info
.
.
.
 Screen Shots
.
.
* CGI examples
.
.
.
 About Spam
.
.
.
 Copyright Infringement
.
.
.
 TLD Master Contract
.
.
.
 ICANN Policy
.
.
  Search Impulse
.

.
.
.
.

CGI Examples for Impulse Internet Services:

  1. Form to Email (formMail) script
  2. Hit Counter

Form to Email (formMail):
We are implementing a form to mail cgi using NMS formMail, a popular alternative to the often used "Matt's formMail". We believe it is much more secure, while providing a virtually identical interface and some additional features. Below is a slightly edited section of the ReadMe accompanying NMS FormMail. It has been modified in the text an examples to make specific references to how things are set up here at Impulse. (If you would like to read the original, click on the above link to NMS, download the formMail scripts onto your computer and read the file entitled README.)

.
.
.
.
.
 Form Configuration:
..
 

To make use of this, you need to write an HTML form that refers to the FormMail script. Here's an example which will send mail to the address 'you@impulse.net' when someone submits the form:

<form method="post" 
      action="https://secure.impulse.net/cgi-bin/FormMail.pl">
 
<input type="hidden" name="recipient" value="you@impulse.net">
 
Please enter your comments below:
 
<br>
 
<input type="text" name="feedback">
 
<br>
 
<input type="submit" value="Submit your feedback!">
 
</form>
The above form embedded in HTML would look like this:
Please enter your comments below:

See how the hidden 'recipient' input in the example above told formmail who to send the mail to? This is how almost all of formmail's configuration works. Here's the full list of things you can set with hidden form inputs:
 
recipient-The email address to which the form submission should be sent. If you would like it copied to more than one recipient then you can separate multiple email addresses with commas, for example:
<input type="hidden" 
       name="recipient"
       value="you@impulse.net,me@xyz.com">
If you leave the 'recipient' field out of the form, formmail will generate an error.
 
subject-The subject line for the email. For example:
<input type="hidden" 
       name="subject"
       value="From the feedback form">
redirect-If this value is present it should be a URL, and the user will be redirected there after a successful form submission. For example:
<input type="hidden" 
       name="redirect"
       value="http://www.impulse.net/">
If you don't specify a redirect URL then instead of redirecting formmail will generate a success page telling the user that their submission was successful.
 
bgcolor-The background color for the success page. For example:
<input type="hidden" 
       name="bgcolor"
       value="red">
background-The URL of the background image for the success page. For example:
<input type="hidden" 
       name="background"
       value="http://www.my.site/img.gif">
text_color-The text color for the success page. For example:
<input type="hidden" 
       name="text_color"
       value="green">
link_color-The link color for the success page. For example:
<input type="hidden" 
       name="link_color"
       value="blue">
vlink_color-The vlink color for the success page. For example:
<input type="hidden" 
       name="vlink_color"
       value="yellow">
alink_color-The alink color for the success page. For example:
<input type="hidden" 
       name="alink_color"
       value="orange">
title-The title for the success page. For example:
<input type="hidden" 
       name="title"
       value="Thank you for your input!">
return_link_url-The target URL for a link at the end of the success page. This is normally used to provide a link from the success page back to your main page or back to the page with the form on. For example:
<input type="hidden" 
       name="return_link_url"
       value="/index.html">
return_link_title-The label for the return link. For example:
<input type="hidden" 
       name="return_link_title"
       value="Back to my home page">
sort-This sets the order in which the submitted form inputs will appear in the email and on the success page. It can be the string 'alphabetic' for alphabetic order, or the string "order:" followed by a comma separated list of the input field names, for example:
<input type="hidden" 
       name="sort"
       value="order:name,email,comments">
If "order:" is used you must supply the names of all of the fields that you want to be in the body of the mail message.
 
print_config-This is mainly used for debugging, and if set it causes formmail to include a dump of the specified configuration settings in the email. For example:
<input type="hidden" 
       name="print_config"
       value="title,sort">
... will include whatever values you set for 'title' and 'sort' (if any) in the email.
 
required-This is a list of fields that the user must fill in before they submit the form. If they leave any of these fields blank then they will be sent back to the form to try again. For example:
<input type="hidden" 
       name="required"
       value="name,comments">
missing_fields_redirect-If this is set, it must be a URL, and the user will be redirected there if any of the fields listed in 'required' are left blank. Use this if you want finer control over the the error that the user see's if they miss out a field. For example:
<input type="hidden" 
       name="missing_fields_redirect"
       value="/missing_fields.html">
env_report-This is a list of the CGI environment variables that should be included in the email. This is useful for recording things like the IP address of the user in the email. The environment variables that you may use are:
  • REMOTE_HOST: contains the hostname of the visitor if it is available.
  • REMOTE_ADDR: contains the IP address of the visitor.
  • REMOTE_USER: contains the username of the visitor if they are logged into a htaccess protected realm
  • HTTP_USER_AGENT: the web browser's id string with which the page was accessed.
For example:
<input type="hidden" 
       name="env_report"
       value="REMOTE_ADDR,HTTP_USER_AGENT">
print_blank_fields-If this is set then fields that the user left blank will be included in the email. Normally, blank fields are suppressed to save space. For example:
<input type="hidden" 
       name="print_blank_fields"
       value="yes">
As well as all these hidden inputs, there are a couple of non-hidden inputs which get special treatment:
email-If one of the things you're asking the user to fill in is their email address and you call that input 'email', formmail will use it as the address part of the sender's email address in the email.
realname-If one of the things you're asking the user to fill in is their full name and you call that input 'realname', formmail will use it as the name part of the sender's email address in the email.

.


Hit Counter:
We are implementing a counter, and timer script using WWWCount, a fairly flexible counter solution. The original author wrote a lengthy documentation with examples about this program. Please use the following link to access the counter:
src="https://secure.impulse.net/cgi-bin/Count.cgi?dd=B|display=counter"
To get things to actually 'count' you will have to specify a datafile using the df parameter:
src="/cgi-bin/Count.cgi?display=counter|dd=C|ft=3|df=/mycount.dat"
Here are some examples of what the parameters with this counter look like:
dd=Add=Bdd=Cdd=D
 
<img src="https://secure.impulse.net/cgi-bin/Count.cgi?ft=0|md=6|dd=A|display=date|timezone=GMT-0800">
 
<img src="https://secure.impulse.net/cgi-bin/Count.cgi?ft=3|md=6|dd=A|display=clock|timezone=GMT-0800">
 
<img src="https://secure.impulse.net/cgi-bin/Count.cgi?ft=6|md=7|dd=A|display=counter">
 
<img src="https://secure.impulse.net/cgi-bin/Count.cgi?ft=6|md=7|dd=A|display=counter|degrees=270|frgb=FF4040|comma=T">

 

© 1998 - 2008, Impulse Internet Services - All Rights Reserved - Contact Us
81 David Love Place, Suite 100 - Santa Barbara, CA 93117