Immortal
12-15-2003, 10:14 PM
I wanted these files to link and make 1 big file at news.html
here is the code:
<?php
$header = 'header.txt';
$footer = 'footer.txt';
$file = 'news.htm';
$filename = 'news.html';
$headerbuff = file_get_contents($header);
$footerbuff = file_get_contents($footer);
$filebuff = file_get_contents($file);
if(is_writable($filename)) {
if(!@file_put_contents($filename, $headerbuff.$filebuff.$footerbuff)){
echo "Unable to write to file $filename";
}else{
echo "Success writing to $filename";
}
} else {
echo "Unable to write";
}
?>
_________________________________________________
can anyone tell me why it writes nothing to the file?
here is the code:
<?php
$header = 'header.txt';
$footer = 'footer.txt';
$file = 'news.htm';
$filename = 'news.html';
$headerbuff = file_get_contents($header);
$footerbuff = file_get_contents($footer);
$filebuff = file_get_contents($file);
if(is_writable($filename)) {
if(!@file_put_contents($filename, $headerbuff.$filebuff.$footerbuff)){
echo "Unable to write to file $filename";
}else{
echo "Success writing to $filename";
}
} else {
echo "Unable to write";
}
?>
_________________________________________________
can anyone tell me why it writes nothing to the file?