So you want to be able to make the change yourself, after the user enters the data, right?
This is completely untested, but ought to work.
Code:
sub modify_record {
# --------------------------------------------------------
my ($status, $line, @lines, @data, $output, $found, $restricted);
$status = &validate_record; # Check to make sure the modifications are ok!
if ($per_admin) {
# [keep all the rest of the subroutine as it is]
# end with the following lines that are already in the subroutine
else {
&html_modify_failure($status); # Validation Error
}
}
# mail modifications, if entered by a user
else {
if ($status eq "ok") {
$mailprog = $mailprog = "|/usr/lib/sendmail -t"; # adjust to the mail program on your server
$admin_email = you\@server.com # use your own email address
open (MAIL, "$mailprog") or &cgierr( "Can't start mail program");
print MAIL "To: $admin_email\n";
print MAIL "From: $admin_email\n";
print MAIL "Subject: Modified Record\n\n";
foreach $column (@db_cols) {
print MAIL "$column: $in{$column}\n";
}
close MAIL;
# send the user to a page telling them that the modification has been sent
}
else {
&html_modify_failure($status); # Validation Error
}
}
}
You'll also need to create a page that tells the user the modification has been sent. A new subroutine in html.pl should do it -- maybe similar to html_delete_success.
I'm not sure why you got the results you did. I'd have to see the code you used.
------------------
JPD