Hi all,
Why does the below fail to create a copy of the template.php page? I want to assign the copy a new name and save it.
Below gives the error : failed to copy template.php
Where am I going wrong?
Thanks.
$file = 'template.php'; //TEMPLATE
echo $newfile = $title.'.php'; // COPY
// copy over files
if (!copy($file, $newfile)) {
echo "failed to copy $file...\n";
}
else
{
echo 'File Created.';
}
// open copied file
$fp = fopen($newfile, "w");
fwrite($fp, $output);