I don't know that it'll help, but I'll take a stab at your issues.
First, Apache vs. IIS: I don't know that things will be much different, but there are a few things you'll want to look out for.... Since the server will likely be 'Nixy, check pathnames....
<?
include 'c:\myfolder\config.php'; # win
// should be instead:
include '/usr/local/myfolder/config.php';
Now, I'd suggest making use of some centralized configuration file to hold these values, and storing the values themselves in $variables. That way, when it's time to move the site, you change the values assigned to the $variables in the config file, but your scripts are all cool 'cause they're just calling $name_of_config_file or whatever.
The second issue (the database one) is probably tricker. No doubt there is someone here who has some strong magic for this one, but the only thing I'm thinking of at the moment is to write your own wrapper functions around your database calls. That way, when it's time to move, you change the calls in the wrapper function only, and your scripts stay the same. Here's an example, something I've been using on a plaything I'm doing. (BTW, nobody's ever called me a great coder...) The first function is just the db connection. The second is a wrapper around a query using variables.
include "/path/to/config.php";
function db_conn() {
$result = @mysql_pconnect($dbhost, $dbuser, $dbpass);
if (!$result) {
return false;
}
if (!@mysql_select_db("$dbname")) {
return false;
}
return $result;
}
function query_array($action, $what, $table) {
$connect=db_conn();
if (!$connect) {
$error="Could not connect to database";
}
switch ($action) {
case "select":
$preposition="from";
break;
case "insert":
$preposition="into";
break;
}
$sql="$action $what $preposition $table";
$result=mysql_query($sql);
if (!$result) {
$error = $error. " No result variable... ";
}
$res_array = array();
for ($count=0; $row = @mysql_fetch_array($result); $count++) {
$res_array[$count] = $row;
}
if ($res_array) {
return $res_array;
}
else {
return $error;
}
}
Now, in my scripts, I just do this:
$users=query_array("select", "users", "members");
...or whatever. The idea is that you have all the specific odbc/mysql/whatever calls in your own functions, and to have those functions in a single file or small set of included files; then, when you need to port it to something else, you change the functions in the include files, but not the scripts.
I think it's a valid idea; seems to be what's done in general practice. Somebody better than me may tell you different, though....
HTH,