Here is the PHP file:
<?
$orig_filename = "/home/mizzory/www/$location$old_name";
$new_filename = "/home/mizzory/www/$location$new_name";
$success = copy($orig_filename, $new_filename) or die("Couldn't copy file.");
if ($success) {
$msg = "Copied $orig_filename to $new_filename";
} else {
$msg = "Could not copy file.";
}
?>
<HEAD>
<TITLE>Copy a File</TITLE>
</HEAD>
<BODY>
<? echo "$msg"; ?>
</BODY>
And here is the HTML Form:
<head>
<title>Copy Files</title>
</head>
<body>
<form method="post" action="copyfile.php">
<p><strong>Location of file (without the filename):</strong><br>
http://www.mizzory.org/MizzHost/<input type="text" name="location"></p>
<p><strong>Original file name:</stong><br>
<input type="text" name="old_name" size="50"></p>
<p><strong>New Filename:</strong><br>
<input type="text" name="New_name" size="50"></p>
<p><input type="submit" name="submit" value="Submit"><input type="reset" value="Reset" name="reset"></p>
</form>
</body>
If you can't see that or something is wrong, go to: http://www.mizzory.org/copyfile.html and try it out. copyfile.html is the HTML form and the PHP script is at: http://www.mizzory.org/copyfile.php