Menu
I am trying to write this into a php file as a dynamic site install script?
How can i get the fwrite to write the php as code into the php file?
[code=php]
$config <<<HTML
<?php
$dbh = mysql_connect (‘localhost’,
‘”.$dbuserame.”‘,
‘”.$dbpassword.”‘)
or die(‘I cannot connect to the database because: ‘ . mysql_error());
mysql_select_db(‘”.$dbdatabase.”‘);
?>
HTML;
//Comments are for girls
$filename = “connection.php”;
if(chmod($filename, 0777)){}
$create = fopen($filename, ‘w+’) or die(“Can’t create the configeration file”);
fwrite($create,$config);
fclose($create);
if(chmod($filename, 0644)){}
Yet that doesnt seam to work ?