Or, you could cut and paste the subs from subscribe.cgi into add.cgi and rename sub main to sub main_newsletter and then add &main_newsletter; before the add_success page is shown and then change
sub main_newsletter {
# --------------------------------------------------------
$|++; # Flush Output.
my %in = &parse_form;
my $action = $in{'action'};
CASE: {
($action eq "subscribe") and do { &subscribe (%in); last CASE; };
($action eq "unsubscribe") and do { &unsubscribe (%in); last CASE; };
&site_html_mailing();
};
}
......to.........
sub main_newsletter {
# --------------------------------------------------------
$|++; # Flush Output.
my %in = &parse_form;
my $action = $in{'newsletter'};
CASE: {
($action eq "subscribe") and do { &subscribe (%in); last CASE; };
&site_html_mailing();
};
}
.......and add the new newsletter field in add.html and then change.......
sub subscribe {
# -----------------------------------------------------------
# Adds a user into a mailing list.
#
my %in = @_;
my $list = $db_email_name;
# Make sure the email address at least looks like an email address.
my $email = $in{'email'};
my $name = $in{'name'};
..........to
sub subscribe {
# -----------------------------------------------------------
# Adds a user into a mailing list.
#
my %in = @_;
my $list = $db_email_name;
# Make sure the email address at least looks like an email address.
my $email = $in{'Contact Email'};
my $name = $in{'Contact Name'};
..so it uses the same fields as add.html
Paul Wilson.
new -
http://www.wiredon.net