Copying Files in PHP

Copying Files in PHP: 
The copy() function is very simple: It needs to know the original filename and a new filename, and that’s all there is to it.

$orig_filename = "e:/ashu2.txt";
$new_filename = "e:/ashu2.bak";
$success = @copy($orig_filename, $new_filename) or die ("Unable to copy file");
$msg = "file $orig_filename copied in $new_filename";
$msg = "Error copying file";
File Copying Script
<? echo $msg; ?>



No comments:

Post a Comment