You could just use a variable, but when I make something like a vars.php file to store settings, I personally use define().
Also, since "definitions"/constants, whatever, don't require you to use a $ sign, it helps distinguish them from other variables.
PHP Code:<?php
define('DB_HOST','localhost');
define('DB_USER','username');
define('DB_PASS','password');
define('DB_NAME','digirev');
function db_connect() {
$f_dbc = @mysql_connect(DB_HOST,DB_USER,DB_PASS) or die(mysql_error());
mysql_select_db(DB_NAME) or die(mysql_error());
return $f_dbc;
}
?>




Reply With Quote