I am new to OOPS esp in PHP and I am stuck here -
I have a file called dat.php which has a class defined in it. This class has usual functions for database connectivity and error reporting if not connected etc. I use this file anywhere in my application I want to connect to my database.
The constructor is
Problem is that I have to encrypt the password (using another encryption function) and retrieve it from another file and I do not want to put username and password here in this file and I do not know how to do that. I definitely cannot remove this class as it has been used at a lot of places.
Can anyone help please?
Thanks,
AJ
I have a file called dat.php which has a class defined in it. This class has usual functions for database connectivity and error reporting if not connected etc. I use this file anywhere in my application I want to connect to my database.
The constructor is
Code:
function DB {
$this->host = 'XXXXXXXX';
$this->user = 'XXXXXXXX';
$this->password = 'XXXXXXXXXX';
$this->database = 'XXXXXXXX';
$this->persistent = false;
}
Can anyone help please?
Thanks,
AJ
Comment