Gossamer Forum
Home : Gossamer Threads Inc. : Discussion :

Re: Add a link & also include newsletter subscription

Quote Reply
Re: Add a link & also include newsletter subscription In reply to
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
Subject Author Views Date
Thread Add a link & also include newsletter subscription techutopia 7896 Feb 22, 2001, 8:15 AM
Thread Re: Add a link & also include newsletter subscription
Paul 7737 Feb 22, 2001, 8:22 AM
Thread Re: Add a link & also include newsletter subscription
techutopia 7731 Feb 22, 2001, 8:29 AM
Post Re: Add a link & also include newsletter subscription
Paul 7673 Feb 22, 2001, 8:31 AM
Thread Re: Add a link & also include newsletter subscription
Thomas. 7700 Feb 22, 2001, 9:12 AM
Thread Re: Add a link & also include newsletter subscription
Paul 7709 Feb 22, 2001, 9:39 AM
Thread Re: Add a link & also include newsletter subscription
techutopia 7677 Feb 23, 2001, 2:15 AM
Thread Re: Add a link & also include newsletter subscription
Paul 7685 Feb 23, 2001, 4:54 AM
Thread Re: Add a link & also include newsletter subscription
techutopia 7678 Feb 28, 2001, 4:27 AM
Post Re: Add a link & also include newsletter subscription
Paul 7597 Feb 28, 2001, 4:39 AM