View Single Post
02-08-2007, 07:41 PM
#29
Xi0s is offline Xi0s
Status: Sin Binner
Join date: Dec 2006
Location: Huddersfield, UK
Expertise:
Software:
 
Posts: 384
iTrader: 3 / 83%
 

Xi0s is on a distinguished road

Send a message via MSN to Xi0s

  Old

Now here is an idea:

Why not do this:

PHP Code:
$verify = <SHA1 ENCODED PASS>;
include(
"http://remote.com/dbinfo.php"); 
Then in your remote connection info

PHP Code:
class dbConnection{
  var 
$dbprefix;
  var 
$dbname;
  private 
$dbpass;
  private 
$dbuser;
  private 
$dbhost;

  function 
connectionInfo(){
    
$dbpass "xx";
    
$dbuser "xx";
    
$dbhost "xx.xx.xx.xx";
    
$dbprefix "prefix_";
  }

  function 
connect(){
    
$this->connectionInfo();
    if(
$verify != sha1("password")){
      die(
"Verification Error");
    } else {
      
$conn mysql_pconnect(CONNECT);
      
mysql_select_db(SELECT DB$conn);
    }
  }
}

$connection = new dbConnection();
$connection->connect(); 
Then just use $connection->dbprefix; for your db prefix.

Just an idea, should technically work, while keeping your private vars private, also, you would need to be running PHP ver 5.