Hi,
I am making a mailing list script to beat all others :)
Can someone please tell me why this code tells you that you are not subscribed to the mailing list no matter what you enter?
The format of email.db is email|name so like paul@perlmad.com|Paul Wilson
check();
open(DB,"<$email_db_path$email_db") || die &error("The email database could not be accessed : $!");
@addresses=<DB>;
close(DB);
foreach $line (@addresses) {
chomp $line;
($e,$n) = split(/\|/,$line);
if ($e ne $email) {
&error("You are not subscribed to this mailing list, therefore you cannot unsubscribe.");
}
}
print "Location: $redirect_unsub\n\n";
}I currently have this in email.db
perlmad@perlmad.com|Paul Wilson
...but when I enter the exact information into the unsubscribe form, it gives the error.
Thankyou :)
Paul Wilson.
Installations:
http://www.wiredon.net/gt/
I am making a mailing list script to beat all others :)
Can someone please tell me why this code tells you that you are not subscribed to the mailing list no matter what you enter?
The format of email.db is email|name so like paul@perlmad.com|Paul Wilson
Code:
sub unsubscribe { check();
open(DB,"<$email_db_path$email_db") || die &error("The email database could not be accessed : $!");
@addresses=<DB>;
close(DB);
foreach $line (@addresses) {
chomp $line;
($e,$n) = split(/\|/,$line);
if ($e ne $email) {
&error("You are not subscribed to this mailing list, therefore you cannot unsubscribe.");
}
}
print "Location: $redirect_unsub\n\n";
}
perlmad@perlmad.com|Paul Wilson
...but when I enter the exact information into the unsubscribe form, it gives the error.
Thankyou :)
Paul Wilson.
Installations:
http://www.wiredon.net/gt/