Since my original topic got trunicated with the switch over to SMF I'll repost it

Nice forum software btw, been testing it myself since I hate phpBB with a passion LOL.
Two great code libraries you should learn and use before you start a gaming project are:
Smarty Template System
http://smarty.php.netADODB Database Abstraction Layer
http://adodb.sourceforge.netWhen I begin a project I always start with 3 files that I put in my include directory:
config.server.php
config.game.php
common.lib.php
config.server.php
Hold specific information about the sever like file paths and database connections. You put these in a seperate file set them on your dev server, then on your web host then you should never have to touch the files again

Since mose dev servers don't share the same connection or directory structures as your web host thats why you want to put them in a seperate file.
config.game.php
This file holds all your defines and constants for the game. This way you only have to open a single file to make adjustments to the game instead of opening a bunch of files and making edits.
common.lib.php
In this file you include both the above files then on every page of your game all you have to do is have a single include call to common.lib.php and your all setup with your server specific definitions and game constants.
I also like to thow in some common functions into the common.lib.php file. Ya know the ones that you are going to need in just about anything you program.. Here I'll share what my common.lib.php looks like:
<?
require_once("config.server.php");
require_once("config.game.php");
require_once("adodb/adodb.inc.php");
require_once("smarty/Smarty.class.php");
// Create SMARTY class instance
// See config.server.php for TPL_DIR definition
$tpl = new Smarty;
$tpl->template_dir = TPL_DIR.'templates/';
$tpl->compile_dir = TPL_DIR.'templates_c/';
$tpl->config_dir = TPL_DIR.'configs/';
$tpl->cache_dir = TPL_DIR.'cache/';
// Create ADODB class instance
// See config.server.php for DB Settings
$db = ADONewConnection('mysql'); # eg 'mysql' or 'postgres'
$db->Connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Start random number generator
mt_srand ((double) microtime() * 1000000);
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
function isnumber($amount, $allowzero = false) {
if( $amount < 0 || stristr($amount,".") !== false || !is_numeric($amount) ) return false;
if( !$allowzero && $amount == 0) return false;
return true;
}
?>
The function getmicrotime is handy if you want to display how long a function of page generation is taking.
The isnumber function is used when testing input from the browser NEVER trust input from the browser!!!! Some people just love exploiting code so you have to make sure you check ANY AND ALL input. By default the isnumber will return FALSE (not a valid number) when checking 0. The reason I do this is 99.9% of the items I'm checking for are ID's generated by the database and ID's always start with 1 never zero

However once in a while 0 is a valid input so then passing it a true will allow 0 to be a valid number.
Hope this helps you on your journey to coding great games....