Yep shouldn't be a problem to do:
First choose which add.cgi from which site you want to use.
then go into add.cgi and change sub process form to the following:
sub process_form {
# --------------------------------------------------------
my ($key, $status, $line, $output);
# Check the referer.
if (@db_referers and $ENV{'HTTP_REFERER'}) {
$found = 0;
foreach (@db_referers) {
$ENV{'HTTP_REFERER'} =~ /$_/i and $found++ and last;
}
if (!$found) {
&site_html_add_failure ("Auto submission is not allowed in this directory. Please visit the site to add your entry.");
return;
}
}
# This will set system fields like Validated to their proper values.
foreach $key (keys %add_system_fields) {
$in{$key} = $add_system_fields{$key};
}
# Set date variable to today's date.
$in{$db_cols[$db_modified]} = &get_date;
open (ID, "<$db_links_id_file_name") or &cgierr("error in process_form. unable to open id file: $db_links_id_file_name. Reason: $!");
$in{$db_key} = <ID> + 1; # Get next ID number
close ID;
open (ID2, "<
change to location of the other directory id file ") or &cgierr("error in process_form. unable to open id file:
change to location of the
other directory id file. Reason: $!");
$in{$db_key} = <ID2> + 1; # Get next ID2 number
close ID2;
# Validate the form input..
$status = &validate_record(%in);
if ($status eq "ok") {
# Update the counter.
open (ID, ">$db_links_id_file_name") or &cgierr("error in get_defaults. unable to open id file: $db_links_id_file_name. Reason: $!");
flock(ID, 2) unless (!$db_use_flock);
print ID $in{$db_key}; # update counter.
close ID; # automatically removes file lock
# Update the counter.
open (ID2, ">
change to location of the other directory id file") or &cgierr("error in get_defaults. unable to open id file:
change to location of the
other directory id file. Reason: $!");
flock(ID2, 2) unless (!$db_use_flock);
print ID2 $in{$db_key}; # update counter.
close ID2; # automatically removes file lock
# Print out the validate input to a "validation database" where it is stored until
# the admin decides to add it into the real database.
open (VAL, ">>$db_valid_name") or &cgierr("error in add_record. unable to open validate file: $db_valid_name. Reason: $!");
flock(VAL, 2) unless (!$db_use_flock);
print VAL &join_encode(%in);
close VAL; # automatically removes file lock
open (VAL2, ">>
change to other validation db. location") or &cgierr("error in add_record. unable to open validate file:
change to other
validation db. location. Reason: $!");
flock(VAL2, 2) unless (!$db_use_flock);
print VAL2 &join_encode(%in);
close VAL2; # automatically removes file lock
# Send the admin an email message notifying of new addition.
&send_email;
# Send the visitor to the success page.
&site_html_add_success;
}
else {
&site_html_add_failure($status);
}
}
Change the pieces marked in red to the locations of the id file and validation.db on your second site. It's just off of the top of my head but it should work.
Good Luck!
Glenn http://mir.spaceports.com/~glennu/