<% use strict; use vars qw( $dbh ); $Response->Include("head1.inc"); my $template = slurp_template(); my ($aff_email, $aff_pw, $mesg, $aff_id, $aff_name, $sent_mesg); if ($Request->Form("send_password")) { $aff_email = $Request->Form("aff_email"); #clean up form values $aff_email =~ s/^\s*//; $aff_email =~ s/\s*$//; #check required fields if (!$aff_email) { $mesg = "Please enter email address."; goto PRINT_PAGE; } #check if affiliate member my $sth = $dbh->prepare("SELECT affiliate_id, affiliate_name, password FROM Affiliate WHERE affiliate_email=?"); $sth->execute($aff_email); unless (($aff_id, $aff_name, $aff_pw) = $sth->fetchrow) { $sth->finish; $mesg = "Email address is not a valid affiliate email."; goto PRINT_PAGE; } $sth->finish; #send password now my %mail = undef; $mail{"subject"} = "TravelSmart.NET Affiliate Forgotten Password"; $mail{"from"} = "affiliate\@travelsmart.net"; $mail{"to"} = $aff_email; $mail{"mesg"} = qq{ A request for your password has been made on TravelSmart.NET Affiliate Program. If you did not make this request don't worry. This message can only be sent to the e-mail address associated with your profile. If you did not make this request it is safe to disregard this message. Your log in information: Affiliate password: $aff_pw E-mail used to create account: $aff_email Login at https://www.infophil.com/travelsmart2/aflogin.asp Thank you for using TravelSmart.NET. Best Regards, TravelSmart.NET Support http://www.travelsmart.net Hotels/Car Rentals: hotels\@travelsmart.net Resorts: resorts\@travelsmart.net Phone: +63 2 897-8709 Fax: +63 2 896-4678 ------------ Get the latest travel deals, promo rates and travel articles for FREE at: http://www.travelsmart.net/ph/mailing_list/ Please send your comments and suggestions at: http://www.travelsmart.net/Feedback.htm}; $mail{"headers"} = << "EOF"; Content-Type: text/plain; charset=iso-8859-1 Precedence: bulk EOF open (MAIL, "|/usr/sbin/sendmail -t"); print MAIL "From: ",$mail{"from"},"\n"; print MAIL "To: ",$mail{"to"},"\n"; print MAIL $mail{"headers"}; print MAIL "Subject: ",$mail{"subject"},"\n\n"; print MAIL $mail{"mesg"}; close(MAIL); $sent_mesg = "Your password has been sent to $aff_email." } PRINT_PAGE: my $template_body = qq{ }; if ($mesg) { #display error message $template_body .= qq{}; } $template_body .= qq{
F O R G O T  P A S S W O R D

$mesg
}; if ($sent_mesg) { #if email has been sent, display the sent message plus the links $template_body .= qq{

$sent_mesg

Affiliate Login | Send Inquiry

}; } else { #display form $template_body .= qq{
Email Address:
 

 

If you can't remember your password, simply enter the E-MAIL you used when you registered and we will immeditately send you your login and password information.

Kindly send email to affiliate\@travelsmart.net if you don't receive any email with your password.

Thank You.
}; } $template_body .= qq{

 

 

 

 

 

 

 

 

 

 

}; $template =~ s//$template_body/s; print $template; $dbh->disconnect(); %>