#!/usr/bin/perl -w ####################################################### # Email Management System # Created by Aaron Anderson # Contact me at: sulfericacid@qwest.net ####################################################### use strict; use warnings; use POSIX; use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); # You are requested not to change any configurations in this file. # Everything is setup to function as-is, any tamporing may damage # the script. require SDBM_File; my %emails; my $snail = "snail.dbm"; #change to location of snail mail database my $list = "mylist.dbm"; #change to location of email database my $adminmail = 'admin@test.com'; my $sendmail = "/usr/lib/sendmail"; tie %emails, 'SDBM_File', $list, O_CREAT | O_RDWR, 0644; if ( !tied %emails ) { print "database unsuccessful $!.\n"; } print header, start_html('Email Management'); if(param()){ my $email = param('email'); my $name = param('name'); my $add1 = param('add1'); my $add2 = param('add2'); my $city = param('city'); my $zip = param('zip'); my $country = param('country'); if (($name) && ($email)) { if (exists $emails{$email}) { print "
Email already exists in mailing list
"; } else { $name =~ s/Your information was submitted!"; } } else { if ($name) { print "
Your email address was missing
"; } elsif ($email) { print "
name is missing
"; } else { print "
You can't submit an empty form
"; } } } my $name = param('name'); my $email = param('email'); my $add1 = param('add1'); my $add2 = param('add2'); my $city = param('city'); my $zip = param('zip'); my $country = param('country'); print <<"END";
Join our mailing list
Name:
Email:
Address line 1:
Address line 2:
City/State:
Zip Code: Country:
 

 

* To remove yourself from our lists, only the email address is required to process your request.

* By submitting your information, you are granting us permission to mail you on occasion, not to sell it for profit.

END print end_html();