the complete webmaster
tutorials reviews reference
ASP
CGI
FrontPage
HTML
Java
JavaScript

Sponsored by El Scripto

Visit the Mortgage Loan Place for Home Loans and also click here to find VA Loans on our site.

Open software to automate your online business

home / articles / cgi

Utilizing the Simple Email List Manager

The simple email list manager has many useful features. This week's article will introduce you to some of them. After learning what the list manager is and how to set up the list manager, you'll want to know how to integrate it into your web site.


To provide a box, similar to the image above, where visitors can enter an email address, the HTML is quite simple:
 <form action="/cgi-bin/elist.pl" method=post>
 <input name="email" size=20 maxlength=100 value="">
 <input type="submit" value="Subscribe">
 </form>
The HTML code can add or remove a user name from the list. The elist.pl script knows that if an address is already in the list, then entering it again will automatically remove it.

If, however, you'd prefer to *always* add an address, just add the following code before </form>:

 <input type="hidden" name="cmd" value="a">
Similarly, to have a special box where entering an address will always delete it, use the following before </form>:
 <input type="hidden" name="cmd" value="d">
Of course, we could get a little bit more creative. The following allows the user to choose to be added or removed:
<form action="/cgi-bin/elist.pl" method=post>
 Email Address: 
 <input name="email" size=20 maxlength=100 value=""><br>
 Action:
 <select name="cmd">
  <option value="a">Add to List
  <option value="d">Remove from List
 </select>
 <input type="submit" value="Do It">
</form>

Now that users can use the list, you can take the time to explore the administrative features available. To provide a link to view the entire list, a password must be used. That password could be included in the HTML document, but it's probably safer to require an input field for it. The following code is one such example:

<form action="/cgi-bin/elist.pl" method=post>
 <input type="password" name="pass" size=10>
 <input type="hidden"   name="cmd"  value="list">
 <input type="submit"   value="Display the List">
</form>

Author: Doug Steinwand
Date: [10/21/97]

More articles about CGI
More articles by Doug Steinwand
Author Biography

Open software to automate your online business
write for us about us advertise

Copyright 1997, 1998 A Big Lime. All rights reserved.