Code: Select all
<?
$orig_filename = "test.html";
$success = @copy($orig_filename, $orig_filename.'.bak') or die("Couldn't copy file.");
if ($success) {
$msg = "Copied $orig_filename to $original_filename.'bak'";
} else {
$msg = "Could not copy file.";
}
?>
<HTML>
<HEAD>
<TITLE>Copy a File</TITLE>
</HEAD>
<BODY>
<? echo "$msg"; ?>
</BODY>
</HTML>