Hello!
I have the following code below. When I run the setup.php that contaisn this code, it writes to a file. But, the output written to the file is in one long line. I need it to put breaks in between each line. What do I need to add to the following code to get it to output the information right?
Here is the code that writes to the file:
write_config($POST['host'],$POST['user'],$POST['password'],$POST['table'],$POST['perpage'],$POST['description'],$POST['admin_user'],$POST['admin_password']);
}
function write_config($host,$user,$password,$table,$pages,$des,$admin_user,$admin_password){
$fp = fopen('port.config.php', "w");
if(!$fp){
setup_index('Unable to open port.config.php Try Chmoding it 777');
}
$f .= '<?';
$f .= '## Pages Per Page';
$f .= '$' . 'perpage = '.$pages.';';
$f .= '$' . 'description_length = '.$des.';' ;
$f .= '## MySQL';
$f .= '$' . 'server = "'.$host.'";' ;
$f .= '$' . 'user = "'.$user.'";' ;
$f .= '$' . 'password = "'.$password.'";';
$f .= '$' . 'database = "'.$table.'";';
$f .= '$' . 'admin_user = "'.$admin_user.'";';
$f .= '$' . 'admin_password = "'.$admin_password.'";' ;
$f .= '?>';
fwrite($fp, $f);
fclose($fp);
}
========================
This is how the ouput file looks:
<?## Pages Per Page$perpage = 10;$description_length = 150;## MySQL$server = "localhost";$user = "shaxs";$password = "password";$database = "db_database";$admin_user = "shaxs";$admin_password = "test";?>
====================
How I need it to look:
<?
Pages Per Page
$perpage = 10;
$description_length = 150;
MySQL
$server = "localhost";
$user = "shaxs";
$password = "password";
$database = "db_database";
$admin_user = "shaxs";
$admin_password = "test";
?>