| the complete webmaster | ||||
| tutorials | reviews | reference | ||
|
Email List ManagerThere are many ways to keep track of who visits your web site. One of the simplest involves asking each user for an email address. That way, you'll be able to notify them of changes and enhancements to your web site. Using something like: ![]() Now, on your web server, you'll need a way to collect these email addresses. Also, it would be helpful if a user could easily remove his or her email address from your list. Using the script presented this week, you'll be able to add, delete and view the users on your mailing list. In Part II (coming sometime in the future), you'll be able to automatically send a message or newsletter to everyone or just selected members on your mailing list. Design The approach that I took to design this program is rather straightforward. When the user enters an email address, the current database is searched. If the user is not in it, the address will be added. If, however, the user's name is in the list, it will display a message asking if the address should be removed. In this way, an address can be added or removed with a minimum amount of hassle. This also presents the primary weakness in the design: Anybody can enter any email address. If you want to sign up billg@microsoft.com, there's nothing to stop you. So, as the administrator of the list, you'll need to be careful to not let it turn into a spamfest. When an address is added or removed, the script uses html files to format
and display the its messages. All the files used by the script are stored
in a single directory, named $HOME in the Perl source file. Here's a list
of the files that it uses:
Another feature is that the current contents of the list can be displayed and edited. ![]() Try out the working demo. Then, download the entire source code package. Before using the source files, you'll need to modify at least the index.html and elist.pl files to work on your system. The file index.html should have the <form action=... > tag set to point to the cgi-bin directory on your web server. Then, elist.pl (the main script), will need to be edited. The $HOME variable should be the path where you stored the other html files and email name list (emaillist.txt) that the script will use. Finally, set the protection on emaillist.txt so that the web server can read and write to it. Part II will appear soon. Author: Doug Steinwand
More articles about CGI |
| write for us | about us | advertise |
Copyright 1997, 1998 A Big Lime. All rights reserved.