Hi!
I have added mod for sending an email to admin when record is added. Problem is that it just send a message:
"The following record was added to the database:"
and then no data of the record. This is the code I have put in html.pl:
open (MAIL, "$mailprog") || &cgierr("Can't start mail program");
print MAIL "To: $admin_email\n";
print MAIL "From: $admin_email\n";
print MAIL "Subject: $html_title New Record\n\n";
print MAIL "The following new record has been added to the database:.\n\n";
foreach $col ($db_cols) {
print MAIL "$col -- $rec{$col}\n";
}
close (MAIL);
It doesn't fetch the records data.
Any idea ?
And I would also like to have the name of the user who add this record. How do I do that ?
Sasa
I have added mod for sending an email to admin when record is added. Problem is that it just send a message:
"The following record was added to the database:"
and then no data of the record. This is the code I have put in html.pl:
Code:
my (%rec) = &get_record($in{$db_key}); open (MAIL, "$mailprog") || &cgierr("Can't start mail program");
print MAIL "To: $admin_email\n";
print MAIL "From: $admin_email\n";
print MAIL "Subject: $html_title New Record\n\n";
print MAIL "The following new record has been added to the database:.\n\n";
foreach $col ($db_cols) {
print MAIL "$col -- $rec{$col}\n";
}
close (MAIL);
It doesn't fetch the records data.
Any idea ?
And I would also like to have the name of the user who add this record. How do I do that ?
Sasa