php - copy problem
| From: | Craig Westerman | Date: | Wed, 03 Apr 2002 17:10:55 +0000 |
| Subject: | php - copy problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-91327@lists.php.net to get a copy of this message | ||
I'm trying to copy daily Analog Stats Report to a archive file. (see code
below) Destination file doesn't exist. I get this error:
Warning: Unable to create '030402.html': Permission denied in
/usr/www/users/cfth/WWW_REPORTS/analogarchive.php on line 9
/WWW_REPORTS/analogarchive.php:Error failed to copy the file www.html
It appears to be a permission problem. How do I set permissions to allow me
to do this?
Thanks
Craig ><>
westerman@chanuteks.com
<?php
# copy daily analog report to archive file
$filename = "www.html";
$newfn = date("dmy");
$fnex = ".html";
if (!file_exists($filename)) {
echo "Sorry cannot find the file $filename";
} else {
if (!copy($filename, $newfn.$fnex)) {
echo "$PHP_SELF:Error failed to copy the file $filename";
} else {
echo "The file $filename copied OK to $fn$fnex";
}
}
?>