new function for writing database credentials to index.php while installing