mirth_prolan wrote in php

I'm trying to make an Install.php for the CMS that I've developed (it's at its 2.0 stage now, with a userpanel and multiple themes and easy customization) but I've run into a loophole:

If I make an install.php, I'd do so as such:

Make the user enter the server name, their server's username, and their server's password.  Using the supplied data, the database and table would be created.  But here's the thing: 

Say I have a table in the database that stores the server's name, username, and password.  How would I connect to the database to retrieve this information if I need to connect using the stored information?

So my question to you is, while I know it's possible, how do I generate a PHP file based off of information placed in a form?

Plan:

Server Name:         |                       |
Server Username: |                       |
Server Password:  |                       |
|SUBMIT|

--> Press submit -->

Theoretically then a php file would be created with the entered information in the CMS' directory to be accessed by all other pages.