You could also do it with sessions.
All you need is a username and password. The databasename etc are all public knowledge anyway.
So, change the config.inc.php to get it's username and password from a session.
Then alter the index script to check wether the username and password were set in the session.
If the session was not started or the data was not set, then make it print a form to enter the username and password and store it in the session.
It's not that difficult. Have a peek at the manual to learn more about how sessions work.