View Single Post
Old 01-21-2004, 09:25 AM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. PhpDig version 1.8.0 already has the following code in the config file:
PHP Code:
if ((isset($relative_script_path)) && ($relative_script_path != ".") && ($relative_script_path != "..")) {
  exit();
}
if (
eregi("config.php",$_SERVER['SCRIPT_FILENAME']) || eregi("config.php",$_SERVER['REQUEST_URI'])) {
  exit();

The code that gives the "Unable to connect to database : Check the connection script" errror is the following:
PHP Code:
// Connection configuration
define('PHPDIG_DB_PREFIX','<dbprefix>');
define('PHPDIG_DB_HOST','<host>');
define('PHPDIG_DB_USER','<user>');
define('PHPDIG_DB_PASS','<pass>');
define('PHPDIG_DB_NAME','<database>');

//connection to the MySql server
$id_connect = @mysql_connect(PHPDIG_DB_HOST,PHPDIG_DB_USER,PHPDIG_DB_PASS);
if (!
$id_connect) {
    die(
"Unable to connect to database : Check the connection script.\n");

Try calling the PhpDig version 1.8.0 connect.php file from the browser. If it throws the "Unable to connect to database : Check the connection script" error, then that means that the database variables are not properly configured.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote