That explains things much better.
There are several things you are working with here. Let's take them one at a time.
I'm going to assume that you will not require users to register before they add a record. Is this correct? If so, you would want the following in your .cfg file:
$auth_allow_default = 1;
@auth_default_permissions = (0,1,0,0,0);
$auth_signup = 0;
$auth_user_field = -1;
(The rest of the permissions wouldn't matter.)
Then you want to have email sent to the admin and the user after a record is added.
(I tried doing a search for this, because I know it's here, but I couldn't figure out what search terms to use.)
In your .cfg file, add
$mailprog = '
the path to sendmail on your system';
$admin_email = '
your email address';
In html.pl, sub html_add_success, add the following, right at the beginning of the subroutine:
Code:
open (MAIL, "$mailprog") | | &cgierr("Can't start mail program");
print MAIL "To: $in{'
email'}\n";
print MAIL "From: $admin_email\n";
print MAIL "Subject: $html_title
Information Received\n\n";
print MAIL "-" x 75 . "\n\n";
print MAIL "
The following information was received at $html_title.\n\n";
foreach $column (@db_cols) {
print MAIL "$column: $in{$column}\n";
}
print MAIL "
Thank you for adding your information.";
close (MAIL);
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
Information Received\n\n";
print MAIL "-" x 75 . "\n\n";
print MAIL "
The following information was received at $html_title.\n\n";
foreach $column (@db_cols) {
print MAIL "$column: $in{$column}\n";
}
close (MAIL);
Checking for duplicated records can be tricky. I would need to know how many records you need to check, what their names are, and whether all of the values would have to be the same (or just one of them) before the record would be rejected.
For mass mailing, you might look at
www.gossamer-threads.com/scripts/forum/resources/Forum12/HTML/001886.html The short/long display mod is at
www.jpdeni.com/dbman/Mods/short_html_pl.txt ------------------
JPD
[This message has been edited by JPDeni (edited March 20, 2000).]