Security with dbHost, dbUser, dbPassword
| From: | Otto Wyss | Date: | Wed, 10 Jan 2007 21:24:36 +0000 |
| Subject: | Security with dbHost, dbUser, dbPassword | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-246859@lists.php.net to get a copy of this message | ||
What is the usual save way to store/use DB access info in a script. I currently just use some PHP variables in a file which I include in all other scripts.
config.php
<?PHP
if (!defined ("config_include")) die ("Error...");
$dbhost = "localhost";
$dbuser = "name";
$dbpass = "password";
$dbname = "database";
$dbcoll = "utf8_unicode_ci";
?>
Is this save enough or are there better ways? Where should I store this file so it isn't accessible via the net but inside scripts?
O. Wyss