I am using the xampp package for mysql and Php on my laptop running windows Vista. I want to allow agencies to create folders and up load pictures to different folders. This is working fine. I also want them to be able to delete folders and pictures. This doesn't work. Every time I try to unlink the specific photos I get
a permission denied error for each unlink attempt.
here are the essentials of my code:
//the folder path:
$folderpath="C:/Program Files/xampp/htdocs/XYproject/uploads/".$agencyusername."".$prog_rec_num."/";
opendir($folderpath);
//the folder
$folder=$agencyusername.''.$prog_rec_num;
//I retrieve the photo file names from the data base and set up the paths
$path1=$folderpath.$photo1;
$path2=$folderpath.$photo2;
$path3=$folderpath.$photo3;
$path4=$folderpath.$photo4;
//I open the files
$hd5=fopen($path1,'w+');
$hd6=fopen($path2,'w+');
$hd7=fopen($path3,'w+');
$hd8=fopen($path4,'w+');
//finally I try to unlink them
$filearray=glob("$folderpath*");
foreach($filearray as $file)
{
unlink($file);
}
I would appreciate anyone's comments,hunches or wild guesses as to a
solution.
Sig