#!/usr/bin/perl # ############################################ ## ## ## Subscribe Me Lite ## ## by CGI Script Center ## ## (e-mail support@cgiscriptcenter.com) ## ## ## ## version: 2.02 ## ## last modified: 01/18/2001 ## ## copyright (c) 1998 - 2001 ## ## ## ## latest version is available from ## ## The CGI Script Center ## ## http://www.cgiscriptcenter.com ## ## ## ############################################ # COPYRIGHT NOTICE: # # Copyright 1998 - 2001 Diran Alemshah. All Rights Reserved. # # This program may be used and modified free of charge by anyone, so # long as this copyright notice and the header above remain intact. By # using this program you agree to indemnify Diran Alemshah and Elite Web # Design and Marketing, Inc. from any liability. # # Selling, redistributing, reverse compiling the code for this program # and any modification of this program without prior written consent is # expressly forbidden. In all cases copyright and header must remain # intact. # # Subscribe Me Lite is registered with the Library of Congress in the # United States of America, and is copyrighted material. # # PROGRAM DESCRIPTION: # # This program is designed to assist users by creating an automatic # customer/prospect mailing list that the customer/prospect can add or # remove themselves from without the assistance of the webmaster. # Subscribe Me has a built-in encrypted password protected form to allow # webmasters to mass mail their mailing list database with. # # Please read the README file that comes with this program for complete # installation and usage instructions, or visit http://www.cgiscriptcenter.com # for posted instructions. # ################################################################# # VERSION HISTORY ################################################################# # See README.txt file # ################################################################# # DO NOT EDIT BELOW PARAGRAPH ################################################################# read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; if ($INPUT{$name}) { $INPUT{$name} = $INPUT{$name}.",".$value; } else { $INPUT{$name} = $value; } } #$cgiurl = $ENV{'SCRIPT_NAME'}; ################################################################ # DO NOT EDIT ABOVE PARAGRAPH ################################################################ ############################################################### ################ Start Required Configurations ################ # Type the full path to your Mail program $mailprog = '/var/qmail/bin/sendmail'; # Type the full path to your Subscribe Me directory # We highly recommend a "non-web" directory. This will protect # your address list from snooping individuals. If you are unsure # if you have access to such a directory, contact your host to find out. $memberinfo = "/path/to/subscribe/"; # Type the full path to your Administration Password directory # We highly recommend a "non-web" directory. This will protect # your address list from snooping individuals. If you are unsure # if you have access to such a directory, contact your host to find out. $passfile = "/path/to/subscribe/"; # Type your email address. Make sure to place a \ in front of the @ # As an example: cgi\@elitehost.com $list_mail = "myemail\@mydomain.com"; # Type the name of your mailing list $list_name = "My Company"; # Type your website URL (example: http://www.yoursite.com) $websiteurl = "http://www.mydomain.com"; # If you are run the script and receive File Locking (flock) # errors, remove the number 2 from between the quotes. # Then it would appear: $LOCK_EX = ""; $LOCK_EX = "2"; # If you would like your mailings to have a closing message, # create a text file called email.txt and upload it to the # directory that you define below. This message will be added # to the end of your mailings. $closing = "/path/to/subscribe/"; # Enter addresses that you would like to ban from signing up for # your mailing list in the banned.txt. $filename = "/path/to/banned.txt"; open (BANNED, "$filename") or die ("Couldn't open $filename: $!"); @banned_array=; close(BANNED); chomp(@banned_array); # If you would like to send your mailings as HTML e-mail, place # the number 1 between the quotes below, like so: # $HTML = "1"; # If, however, you wish to send your mailings as Text only, leave # the variable below as it is. $HTML = ""; # If you would like to provide your subscriber's a way to unsubscribe # from a link in your mailings, place the number 1 between the quotes # below, like so: $unsubscribelink = "1"; # If you do not wish to provide an unsubscribe link, leave the variable # the way it is. $unsubscribelink = "1"; ################ End Required Configurations ################ ############################################################# ############################################################## ########## Start Optional Customize Responses ################ # This is the subject of the "Blocked/Banned" Address # response screen that your subscribers will receive, # if you choose to use the "Address Blocking" feature. # To enable the customized responses, remove the # pound # sybmol from before the variables below. # If you choose not to use customized responses, Subscribe Me # will issue its default responses. #$blocked_subject = "Unable to Process"; #$blocked_message = "We are unable to add your address: to our list at this time."; # This is the subject of the "Already Listed" Address # response screen that your subscribers will receive, # if their address is already listed in your database. # To enable the customized responses, remove the # pound # sybmol from before the variables below. # If you choose not to use customized responses, Subscribe Me # will issue its default responses. #$alreadylisted_subject = "Already Listed!"; #$alreadylisted_message = "Your e-mail address: is already listed in our database."; # This is the subject of the "Already Added" Address # response screen that your subscribers will receive, # if their address is added to your database. # To enable the customized responses, remove the # pound # sybmol from before the variables below. # If you choose not to use customized responses, Subscribe Me # will issue its default responses. #$addressadded_subject = "Success: Address Added"; #$addressadded_message = "Success! Your e-mail address: has been added to our Mailing List!"; # This is the subject of the "Address Removed" Address # response screen that your subscribers will receive, # when their address is removed from your database. # To enable the customized responses, remove the # pound # sybmol from before the variables below. # If you choose not to use customized responses, Subscribe Me # will issue its default responses. #$addressremoved_subject = "Removed!"; #$addressremoved_message = "Your email address: has been removed from our Mailing List. We are sorry to see you go!"; # This is the subject of the "Address Not Found" Address # response screen that your subscribers will receive, # when their address is not found in your database. # To enable the customized responses, remove the # pound # sybmol from before the variables below. # If you choose not to use customized responses, Subscribe Me # will issue its default responses. #$addressnotfound_subject = "Address Not Found!"; #$addressnotfound_message = "Your email address: was not found in our database. Please make sure you spelled the address properly and that you used the same email address that you created your account with"; # This is the subject of the "Improper Address" Address # response screen that your subscribers will receive, # when their address is not found in your database. # To enable the customized responses, remove the # pound # sybmol from before the variables below. # If you choose not to use customized responses, Subscribe Me # will issue its default responses. #$improperaddress_subject = "Improper E-mail Address!"; #$improperaddress_message = "You have entered an improper email address. Please make sure your email address appears in this manner: username\@domain.com, or username\@domain.net, etc. !"; # E-mail Addition Response - Added to List # At the end of each line, you'll see the \n, which stands for New Line. # To wrap the text to the next line, you will want to use the \n symbols. # Feel free to create as many lines as you need, as long as each line starts # with: $line1 .= # and that each section is enclosed in quotations marks, and there is a # semi-colon at the end of each line. $added .= "Subject: You've Been Added!\n\n"; $added .= "This message is to confirm the addition of your\n"; $added .= "email address: to the \n"; $added .= "Mailing List.\n\n"; $added .= "If you feel you have received this notice in error,\n"; $added .= "please visit the Exotic Tropical Mailing List\n"; $added .= "at our website: \n"; $added .= "to remove yourself automatically.\n\n"; $added .= "Thank you,\n\n"; $added .= "\n\n"; # E-mail Removal Response - Removed from List # At the end of each line, you'll see the \n, which stands for New Line. # To wrap the text to the next line, you will want to use the \n symbols. # Feel free to create as many lines as you need, as long as each line starts # with: $line1 .= # and that each section is enclosed in quotations marks, and there is a # semi-colon at the end of each line. $removed .= "Subject: You've Been Removed!\n\n"; $removed .= "This message is to confirm the removal of your\n"; $removed .= "email address: from the \n"; $removed .= "Mailing List.\n\n"; $removed .= "We're sorry to see you go!\n\n"; $removed .= "If you change your mind, you may resubscribe\n"; $removed .= "at our website: \n"; $removed .= "Thank you,\n\n"; $removed .= "\n\n"; $servername = $ENV{'SERVER_NAME'}; $cgiurl = $ENV{'SCRIPT_NAME'}; ############################################################### # DO NOT EDIT BELOW THIS LINE ############################################################### $version = "2.02"; if ($ENV{'QUERY_STRING'}) { $ENV{'QUERY_STRING'} =~ s/\.\.//g; $ENV{'QUERY_STRING'} =~ s/\///g; } $imagetype = "gif"; $INPUT{'graphic'} = $ENV{'QUERY_STRING'} if $ENV{'QUERY_STRING'} eq 'sub3.gif'; if ($INPUT{'subscribe'} eq "subscribe") { &subscribe; } elsif ($INPUT{'subscribe'} eq "unsubscribe") {&unsubscribe; } elsif ($INPUT{'mailing'}) {&mailing; } elsif ($INPUT{'setpwd'}) {&setpwd; } elsif ($INPUT{'enterpass'}) {&passcheck; } elsif ($ENV{'QUERY_STRING'} eq 'sub3.gif') {&display_graphic; } elsif ($ENV{'QUERY_STRING'} =~ /\@/) {&unsubscribe; } elsif ($INPUT{'passcheck'}) {&passcheck; } else {&form; } exit; # Define arrays for the day of the week and month of the year. # @days = ('Sunday','Monday','Tuesday','Wednesday', 'Thursday','Friday','Saturday'); @months = ('January','February','March','April','May','June','July', 'August','September','October','November','December'); # Get the current time and format the hour, minutes and seconds. Add # # 1900 to the year to get the full 4 digit year. # ($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(time))[0,1,2,3,4,5,6]; $time = sprintf("%02d:%02d:%02d",$hour,$min,$sec); $year += 1900; # Format the date. # $date = "$days[$wday], $months[$mon] $mday, $year at $time"; ######################################################## # Subroutine FIND - Will find member info and email it ######################################################## sub setpassword { &header; print<

Subscribe Me Status: Set Password!

You have not yet set your administration password! Please enter your password below, once to set the password and the second time to confirm it.

password
confirmation


EOF &footer; exit; } sub setpwd { if (-e "$passfile/password.txt") { print "Content-type: text/html\n\n"; print "Password already exists. Please delete your password file manually if you want to reset your password
"; exit; } print "Content-type: text/html\n\n"; unless ($INPUT{'pwd'} && $INPUT{'pwd2'}) { &header; print<

Subscribe Me Status: Password Error!

Please enter your password twice. Once to set it, and once to confirm it.

password
confirmation


EOF &footer; exit; } if ($INPUT{'pwd'} && $INPUT{'pwd2'}) { if ($INPUT{'pwd'} ne $INPUT{'pwd2'}) { &header; print<

Subscribe Me Status: Password Mismatch!

The confirmation password you entered did not match the orginal password. Please try again.

password
confirmation


EOF &footer; exit; } } chop ($pwd) if ($pwd =~ /\n$/); $newpassword = crypt($INPUT{'pwd'}, aa); open (PASSWORD, ">$passfile/password.txt")|| die &error('password.txt',$passfile,$!,'$passfile'); if ($LOCK_EX){ flock(PASSWORD, $LOCK_EX); #Locks the file } print PASSWORD "$newpassword"; close (PASSWORD); &header; print<

Subscribe Me Status: Password Success!

Your Administration password has been set! You will not be able to send mail without your password, so please write it down.

To mail to your Subscribe Me mailing list, use your built-in form.

EOF &footer; exit; } sub error { $var1 = shift(); $var2 = shift(); $var3 = shift(); $var4 = shift(); &header; print<

Subscribe Me Status:
Unable to create or edit file: $var1

Your server responded: "$var3".

A response of "Permission Denied" means that either the path, $var2 is incorrectly set in your configurations ($var4), or that you have not set high enough permissions on that directory.


A response of "No such file or directory" means that the path, $var2 is incorrectly set in your configurations ($var4), or that you have not yet created the $passfile directory.

EOF &footer; exit; } sub subscribe { &checkaddress; open (DAT,"<$memberinfo/address.txt"); if ($LOCK_EX){ flock(DAT, $LOCK_EX); #Locks the file } @database_array = ; close(DAT); foreach $lines(@database_array) { chomp($lines); &parseemail; foreach $blockedaddress(@banned_array) { chomp($blockedaddress); $blockedaddress =~ tr/A-Z/a-z/; if (($blockedaddress =~ /\*\@/) || ($blockedaddress !~ /\@/)) { $blockeddomain = $blockedaddress; $blockeddomain =~ s/.*\@//; } if (($email eq $blockedaddress) || ($blockeddomain eq $edomain)) { if ($blocked_subject) { &response($blocked_subject,$blocked_message); } else { print "Content-type: text/html\n\n"; &header; print<

Subscribe Me Status:
Unable to Subscribe

Your address: $email can not be added to our mailing list.

Please contact our administration at $orgmail for more information.

EOF &footer; } exit; } } if ($existing eq $email) { # if ($lines =~ /$INPUT{'email'}/i) { if ($alreadylisted_subject) { &response($alreadylisted_subject,$alreadylisted_message); } else { print "Content-type: text/html\n\n"; &header; print<

Subscribe Me Status: Already Listed!

Your email address: $INPUT{'email'} is already in our database!

If you believe you are not receiving our intended mailings, please contact us at $list_mail for assistance.

EOF &footer; } exit; } } # print "Content-type: text/html\n\n"; open (DAT,">>$memberinfo/address.txt") || die &error('address.txt',$memberinfo,$!,'$memberinfo'); if ($LOCK_EX){ flock(DAT, $LOCK_EX); #Locks the file } print DAT "$INPUT{'email'}\n" || die &error('address.txt',$memberinfo,$!,'$memberinfo'); close (DAT); if ($addressadded_subject) { &response($addressadded_subject,$addressadded_message); } else { print "Content-type: text/html\n\n"; &header; print<

Subscribe Me Status: Success!

Your email address: $INPUT{'email'} has been added to the $list_name Mailing List.

If at any time you desire to be removed from our list, you may do so at our website. Please contact $list_mail if you need any further assistance.

EOF &footer; } unless ($INPUT{'notify_subscriber'} eq "no") { $added =~ s//$INPUT{'email'}/g; $added =~ s//$list_name/g; $added =~ s//$list_mail/g; $added =~ s//$websiteurl/g; open (MAIL, "|$mailprog -t -f \"$list_mail\" ") || print "Can't start mail program"; print MAIL "To: $INPUT{'email'}\n"; print MAIL "From: $list_mail\n"; print MAIL "$added\n\n"; close (MAIL); } exit; } sub unsubscribe { if (($ENV{'QUERY_STRING'}) && ($ENV{'QUERY_STRING'} =~ /\@/)) { $INPUT{'email'} = $ENV{'QUERY_STRING'}; } &checkaddress; open (DAT,"<$memberinfo/address.txt"); if ($LOCK_EX){ flock(DAT, $LOCK_EX); #Locks the file } @database_array = ; close(DAT); foreach $lines(@database_array) { chomp($lines); &parseemail; if ($existing eq $email) { # if ($lines =~ /$INPUT{'email'}/i) { if ($addressremoved_subject) { &response($addressremoved_subject,$addressremoved_message); } else { print "Content-type: text/html\n\n"; &header; print<

Subscribe Me Status: Removed!

Your email address: $INPUT{'email'} has been removed from our database. We are sorry to see you go!

If ever you desire to be re-added to our mailing list, you may do so at our website. Please contact $list_mail for assistance.

EOF &footer; } open (DAT,">$memberinfo/address.txt"); if ($LOCK_EX){ flock(DAT, $LOCK_EX); #Locks the file } foreach $lines(@database_array) { chomp($lines); &parseemail; if ($existing ne $email) { # if ($lines !~ /$INPUT{'email'}/i) { print DAT "$lines\n"; } } close (DAT); unless ($INPUT{'notify_subscriber'} eq "no") { $removed =~ s//$INPUT{'email'}/g; $removed =~ s//$list_name/g; $removed =~ s//$list_mail/g; $removed =~ s//$websiteurl/g; open (MAIL, "|$mailprog -t -f \"$list_mail\" ") || print "Can't start mail program"; print MAIL "To: $INPUT{'email'}\n"; print MAIL "From: $list_mail\n"; print MAIL "$removed\n\n"; close (MAIL); } exit; } } if ($addressnotfound_subject) { &response($addressnotfound_subject,$addressnotfound_message); exit; } else { print "Content-type: text/html\n\n"; &header; print<

Subscribe Me Status: Not Found!

Your email address: $INPUT{'email'} was not found in our database. Please make sure you spelled the address properly and that you used the same email address that you created your account with.

If you need further assistance, please contact $list_mail.

EOF &footer; close (DAT); exit; } } sub form { print "Content-type: text/html\n\n"; unless (-e "$passfile/password.txt") { &setpassword; } &adminpass; } sub form2 { &blindcheck; open (DAT,"<$memberinfo/address.txt"); if ($LOCK_EX){ flock(DAT, $LOCK_EX); #Locks the file } @database_array = ; close(DAT); $count_subscribers = @database_array; $count_banned = @banned_array; if ($count_subscribers == 1) { $countline = "There is currently $count_subscribers subscriber in your mailing list"; } else { $countline = "There are currently $count_subscribers subscribers in your mailing list"; } if ($count_banned == 1) { $countline2 = "There is currently $count_banned banned address in your mailing list"; } else { $countline2 = "There are currently $count_banned banned addresses in your mailing list"; } print "Content-type: text/html\n\n"; &header; &header2; print<
$countline
EOF if ($count_banned) { print "$countline2
"; } print<
Subject:
Administration Password:


Subscribe or Unsubscribe
any addresses here
subscribe
unsubscribe
Do NOT notify subscriber via e-mail
EOF &footer2; &footer; exit; } sub mailing { &blindcheck; ###################################### open (PASSWORD, "<$passfile/password.txt"); $password = ; close (PASSWORD); chop ($password) if ($password =~ /\n$/); if ($INPUT{'password'}) { $newpassword = crypt($INPUT{'password'}, aa); } else { print "Content-type: text/html\n\n"; &header; print<

Subscribe Me Status: Password Error!

Please enter your password!

EOF &footer; exit; } unless ($newpassword eq $password) { print "Content-type: text/html\n\n"; &header; print<

Subscribe Me Status: Password Error!

Incorrect password! Please enter the correct password.

EOF &footer; exit; } ######################################## $pid = fork(); print "Content-type: text/html \n\n fork failed: $!" unless defined $pid; if ($pid) { #parent print "Content-type: text/html \n\n"; &header; print<

Subscribe Me Status: Mailing Success!

Your mailing is now being sent to your Subscribe Me mailing list!

Once your mailing is complete, you should receive an e-mail notification letting you know how many addresses that your mailing was sent to.

Thank you for using Subscribe Me. Please let us know if there any improvements you would like us to consider for the next release of our program, at support\@cgiscriptcenter.com.

EOF &footer; exit(0); } else { #child close (STDOUT); ##### SEND OUT EMAILS HERE ############ #&passcheck; ######### Here is where we did the addition ################### ############################################################### # First, tell the script where to find your email text file open (FILE,"$closing/email.txt"); #### Full path name from root. # Now we read in the email text @closing = ; # Now that's its been read, we can close the text file close(FILE); open (LIST,"<$memberinfo/address.txt"); if ($LOCK_EX){ flock(LIST, $LOCK_EX); #Locks the file } @database_array = ; close (LIST); $countaddresses = @database_array; @message = $INPUT{'message'}; foreach $lines(@database_array) { chomp($lines); open (MAIL, "|$mailprog -t -f \"$list_mail\" ") || print "Can't start mail program"; if ($HTML) { print MAIL "Content-type:text/html\n"; } print MAIL "To: $lines\n"; print MAIL "From: $list_name <$list_mail>\n"; print MAIL "Subject: $INPUT{'mail_subject'}\n\n"; foreach $messageline(@message) { $messageline =~ s/\r//g; print MAIL "$messageline"; } #print MAIL "$INPUT{'message'}"; # Now we tell the script to read each line from your email text file # and paste it into your actual outgoing email. foreach $line(@closing) { print MAIL "$line"; } if ($unsubscribelink) { if ($HTML) { print MAIL "

"; print MAIL "-" x 75 . "
"; print MAIL<
http://$servername$cgiurl?$lines
EOF print MAIL "-" x 75 . "\n\n"; } else { print MAIL "\n\n"; print MAIL "Click on the link below to be removed from the $list_name Mailing List.\n"; print MAIL "http://$servername$cgiurl?$lines\n\n"; } } print MAIL"\n\n"; close (MAIL); } } &mailingcomplete($countaddresses); exit; } sub mailingcomplete { $_ = shift(); open (MAIL, "|$mailprog -t -f \"$list_mail\" ") || print "Can't start mail program"; print MAIL "To: $list_mail\n"; print MAIL "From: $list_mail\n"; print MAIL "Subject: Mailing Complete!\n"; print MAIL "Your Subscribe Me mailing to your $list_name Mailing List is now complete! \n\n"; print MAIL "Your mailing was sent to: $_ email addresses.\n\n"; close (MAIL); } sub checkaddress { $INPUT{'email'} =~ s/\s//g; unless ($INPUT{'email'} =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)|(,)/ || $INPUT{'email'} !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/) { $legalemail = 1; } else { $legalemail = 0; } if ($legalemail !~ 1) { if ($improperaddress_subject) { &response($improperaddress_subject,$improperaddress_message); exit; } else { print "Content-type: text/html\n\n"; &header; print<

Subscribe Me Status: Improper Email Address!

You have entered an improper email address. Please make sure your email address appears in this manner: username\@domain.com, or username\@domain.net, etc. !

If you need extra assistance, please contact us at $list_mail for assistance.

EOF &footer; exit; } } } sub adminpass { my $removebreak = 1; &header; &header2; print<
Subscribe Me Administration Password

The Administration section is restricted to authorized individuals only. Please enter the Administration password below.

Password

EOF &footer2; &footer; exit; } sub passcheck { open (PASSWORD, "$passfile/password.txt"); if ($LOCK_EX){ flock(PASSWORD, $LOCK_EX); #Locks the file } $password = ; close (PASSWORD); chop ($password) if ($password =~ /\n$/); if ($INPUT{'pwd'}) { $newpassword = crypt($INPUT{'pwd'}, aa); } else { print "Content-type: text/html\n\n"; &header; print<

Subscribe Me Status: Password Error!

Please enter your password!

EOF &footer; exit; } unless ($newpassword eq $password) { print "Content-type: text/html\n\n"; &header; print<

Subscribe Me Status: Password Error!

Incorrect password! Please enter the correct password.

EOF &footer; exit; } &form2; } sub response { $var1 = shift(); $var2 = shift(); $var1 =~ s//$email/g; $var1 =~ s//$list_name/g; $var2 =~ s//$email/g; $var2 =~ s//$list_name/g; print "Content-type: text/html\n\n"; &header; print<

Subscribe Me Status:
$var1

$var2

EOF &footer; } sub header { open (FILE,"<$memberinfo/default.header"); #### Full path name from root. if ($LOCK_EX){ flock(FILE, $LOCK_EX); #Locks the file } @headerfile = ; close(FILE); print "$list_name Mailing List Manager \n"; foreach $line(@headerfile) { print "$line"; } } sub footer { open (FILE,"<$memberinfo/default.footer"); #### Full path name from root. if ($LOCK_EX){ flock(FILE, $LOCK_EX); #Locks the file } @footerfile = ; close(FILE); foreach $line(@footerfile) { print "$line"; } } sub blindcheck { open (PASSWORD, "$passfile/password.txt"); if ($LOCK_EX){ flock(PASSWORD, $LOCK_EX); #Locks the file } $password = ; close (PASSWORD); chop ($password) if ($password =~ /\n$/); if ($INPUT{'pwd'}) { $newpassword = crypt($INPUT{'pwd'}, aa); } else { print "Content-type: text/html\n\n"; &header; print<

Subscribe MeStatus: Password Error!

Please enter your password!

EOF &footer; exit; } unless ($newpassword eq $password) { print "Content-type: text/html\n\n"; &header; print<

Subscribe Me Status: Password Error!

Incorrect password! Please enter the correct password.

EOF exit; } } sub footer2 { print "

"; print "

"; } sub header2 { if (-e "$memberinfo/sub3.gif") { print<
Subscribe Me logo Subscribe Me Lite $version
Administration Panel

º Frequently Asked Questions
º Read about Subscribe Me Pro

EOF } else { print<
Subscribe Me Lite $version
Administration Panel

º Frequently Asked Questions
º Read about Subscribe Me Pro

EOF } } sub display_graphic { if ($INPUT{'graphic'}) { print "Content-type: image/$imagetype\n"; print "\n"; $file = "$memberinfo/$INPUT{'graphic'}"; open (IMAGE, "<$file") || die "Can't open $file: $!"; if ($os eq 'nt') { binmode(IMAGE); ## If used on an NT server, remove the "#" at front. binmode(STDOUT); ## If used on an NT server, remove the "#" at front. } while () { print $_; } close(IMAGE); # exit; } } sub parseemail { $email = $INPUT{'email'}; $existing = $lines; $existing =~ tr/A-Z/a-z/; $email =~ tr/A-Z/a-z/; $edomain = $email; $edomain =~ s/.*\@//; }