Yes, you could add this to the html_add_success subroutine.
It probably would be best to add the code at the very end of the subroutine, just before the final
}.
First, get all of the information for the current record into the %rec hash:
Code:
%rec = &get_record($in{$db_key});
Next, you're going to need to build an array of the fields in the "guest" database, since you aren't sending all of the information. Be sure to include the $db_key field from the main database, and make that the key field in the guest database. That way you can be pretty sure you won't have a duplicate key in the guest db.
Code:
@db_cols = ('Field1','Field2','Field3');
Then define the name of your guest database.
Code:
$db_file_name = $db_script_path . "/guest.db";
Finally, add the record to the database.
Code:
open (DB, ">>$db_file_name") or
&cgierr("error in add_record. unable to open database: $db_file_name.\nReason: $!");
if ($db_use_flock) {
flock(DB, 2)
or &cgierr("unable to get exclusive lock on $db_file_name.\nReason: $!");
}
print DB &join_encode(%rec);
close DB;
------------------
JPD