if($_POST["submit"]) {
$server=$_POST["servername"];
$user=$_POST["username"];
$password=$_POST["password"];
$db=$_POST["dbname"];
$myfile = fopen("install/config.php", "w") or die("Unable to open file!");
$txt = "<?php\r\n";
$txt .= "return [ \n";
$txt.="'host' => '".$server."',\r\n";
$txt.="'name' => '".$dbname."',\r\n";
$txt.="'user' => '".$user."',\r\n";
$txt.="'pass' => '".$password."'\r\n";
$txt.="];\n";
$txt.="?>";
fwrite($myfile, $txt);
fclose($myfile);
}