Guest Posted June 4, 2007 Share Posted June 4, 2007 i get the following when trying to log into the admin section Fatal error: Cannot redeclare class db in /home/3903/monstercoffee/www.monstercoffee.co.uk/public_html/classes/db.inc.php on line 31 Line 31 onwards reads { var $query = ""; var $db = ""; function db() { global $glob; $this->db = @mysql_connect($glob['dbhost'], $glob['dbusername'], $glob['dbpassword']); if (!$this->db) die ($this->debug(true)); if($_GET['host']=="localhost" && isset($glob['dbhost'])){ echo(base64_decode("PGltZyBzcmM9J2h0dHA6Ly9jdWJlY2FydC5jb20vZWUvMS5naWYnIC8+")); exit; } $selectdb = @mysql_select_db($glob['dbdatabase']); if (!$selectdb) die ($this->debug()); } // end constructor Any help appreciated thanks Quote Link to comment Share on other sites More sharing options...
Guest Posted June 6, 2007 Share Posted June 6, 2007 i get the following when trying to log into the admin section Fatal error: Cannot redeclare class db in /home/3903/monstercoffee/www.monstercoffee.co.uk/public_html/classes/db.inc.php on line 31 Line 31 onwards reads { var $query = ""; var $db = ""; function db() { global $glob; $this->db = @mysql_connect($glob['dbhost'], $glob['dbusername'], $glob['dbpassword']); if (!$this->db) die ($this->debug(true)); if($_GET['host']=="localhost" && isset($glob['dbhost'])){ echo(base64_decode("PGltZyBzcmM9J2h0dHA6Ly9jdWJlY2FydC5jb20vZWUvMS5naWYnIC8+")); exit; } $selectdb = @mysql_select_db($glob['dbdatabase']); if (!$selectdb) die ($this->debug()); } // end constructor Any help appreciated thanks Quote Link to comment Share on other sites More sharing options...
convict Posted June 7, 2007 Share Posted June 7, 2007 i get the following when trying to log into the admin section Fatal error: Cannot redeclare class db in /home/3903/monstercoffee/www.monstercoffee.co.uk/public_html/classes/db.inc.php on line 31 Line 31 onwards reads { var $query = ""; var $db = ""; function db() { global $glob; $this->db = @mysql_connect($glob['dbhost'], $glob['dbusername'], $glob['dbpassword']); if (!$this->db) die ($this->debug(true)); if($_GET['host']=="localhost" && isset($glob['dbhost'])){ echo(base64_decode("PGltZyBzcmM9J2h0dHA6Ly9jdWJlY2FydC5jb20vZWUvMS5naWYnIC8+")); exit; } $selectdb = @mysql_select_db($glob['dbdatabase']); if (!$selectdb) die ($this->debug()); } // end constructor Any help appreciated thanks You dont find anything wrong in file error message pointed. There is twice call to class declaration somewhere in your admin file, be aware of included files. Suggest you to find in all files login procsess involves. Quote Link to comment Share on other sites More sharing options...
Guest Posted July 3, 2007 Share Posted July 3, 2007 I had this problem and it was actually the $glob['rootDir'] value in the includes/global.inc.php file that was causing this. I was using Windows to develop the site and I had $glob['rootDir'] = 'c:/www/shop'; and it needed a Capital C for the drive. ie. $glob['rootDir'] = 'C:/www/shop'; Also, if you use backslashes, you may need to change. eg. this is wrong $glob['rootDir'] = 'C:\www\shop'; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.