For the scenarios that will be redistributed, it would be better to group them together and either have as constants or variables.
config.php
<?PHP define('DBHOST', 'localhost'); define('DBPORT', '8080'); define('DBNAME', 'my_db_name'); define('DBUSER', 'root'); define('DBPASS', 'password');
db.php
<PHP include('config.php'); $con = mysql_connect(DBHOST.':'. DBPORT,DBUSER,DBPASS); mysql_select_db(DBNAME, $con);
Doing this will make it easier for someone to make changes in the future instead of wasting money through code to find where any connections are made, etc.
For a slightly better security, the config.php script can be placed outside the doc root so that it cannot be called directly.
Peter source share