Using this little guide, You will learn how forum software such as Invision Power Board and vBulletin create their config files which seem to have all the info nessesary without you editing it.
I will give you the code and then exlpain it line by line.
CODE
<form action="" method="post" name="write" id="write">
Name
<input name="name" type="text" id="name">
<br>
Password
<input name="password" type="text" id="password">
<br>
Email
<input name="email" type="text" id="email">
<br>
Database User
<input name="db_user" type="text" id="db_user">
<br>
Database Password
<input name="db_pass" type="text" id="db_pass">
<br>
Database
<input name="db_data" type="text" id="db_data">
<br>
Host
<input name="db_host" type="text" id="db_host">
<br>
<input type="submit" name="Submit" value="Submit">
</form>
<?php
if ($_POST['Submit']) {
extract($_POST);
$file_to_write = 'config.php';
$content .="<?phpn";
$content .="$config['name'] = '$name';n";
$content .="$config['password'] = '$password';n";
$content .="$config['email'] = '$email';n";
$content .="$config['db_user'] = '$db_user';n";
$content .="$config['db_pass'] = '$db_pass';n";
$content .="$config['db_data'] = '$db_data';n";
$content .="$config['db_host'] = '$db_host';n";
$content .="?>";
$fp = fopen($file_to_write, 'w');
fwrite($fp, $content);
fclose($fp);
echo "Successn";
echo "$file_to_writen";
echo "Has been written";
}
?>