Ok, so here's what I have in mind. I assume the program will always check for similar database tables containing the user's Username, Email Address, and IP Address. And in order to do that it must have access to the database. This of course would be different for different programs. So I thought if you made the file with the database information in it named config.php, and "included" it in the main file, you could set it up to read the proper tables in any database.
I have a couple of programs that are set up this way. You write the config.php file something like this:
Code:
<?
$db_user_name='sql_user_name';
$db_host_name='sql_host_name';
$db_name='sql_database_name';
$db_pw='sql_password';
$email_address_table='whatever';
$ip_address_table='whatever';
$username_table='whatever';
?>
Put this in the main file to include it:
Code:
include("config.php");
And where ever you need the access information you just put this in instead of what you normally would:
Code:
$db_user_name
$db_host_name
$db_name
$db_pw
$email_address_table
$ip_address_table
$username_table
Does that make sense? I hope so, because I can't think of a better way to explain it...
Then if you wanted to take it one step farther, you set up a drop menu type thing so you could select pre-set (prior to uploading) settings for different programs, so you could go to an "Admin page" and select which program you want to tie into the database for, and you could change from one program to another on the fly. Say for example you have a forum, a photo gallery that members have the ability to comment on each photo, and a download site that members have the ability to comment on each download file, each with it's own database. Spammers could spam all of them, so you would want to check them for spam registrations. With a multiple-database set up you could do that easily. Just change the DB set up and away you go.
