Welcome to the Browser-Base Game Zone forums!
1. a database storing the current state of the game, 2. a set of HTML forms, representing commands that the player can give, and 3. a set of php scripts that execute these commands by acting on the database...
mysql_query("UPDATE player SET cash = cash - $cost WHERE playerid = $pid");
$db->Execute("UPDATE player SET cash = cash - ? WHERE playerid = ?", array($cost,$pid));