first off, not sure why u wanna be doing this, but thats ur part to think about...
second, why do u have four files for such simple actions as opening ur connection, closing your connection etc.?
once again, thats for u to think about too...
to ur question:
use an html form, with four <inputs>, each with a name that associates to what the data is, such as:
Then, have a submit button (if you don't know how to add a submit button, I suggest you learn plenty about HTML and some basic PHP first before doing this, otherwise you could be opening your system up to some serious security flaws).
<input type="text" name="host">
The form will submit to config.php using a POST, and grab that data by in ur PHP file doing:
$host = $_POST['host'];
Then use the variable $host in your connection info to the DB.
"First time it's a mistake, do it again and it's stupidity."