I've got a file connect.php.
public static function connect() {
$file= file('data.txt');
$hostname = rtrim($file[1]);
$dbname = rtrim($file[4]);
$username = rtrim($file[7]);
$password = rtrim($file[10]);
mysql_connect($hostname, $username, $password) or DIE('Connection to host isailed, perhaps the service is down!');
mysql_select_db($dbname) or DIE('Database name is not available!');
};
How can I access this function in other .php files?
connect();
doesn't work.