Hey guys, doing an assignment for uni, we are hosting our websites on the uni’s unix server, with less then maximum permissions. I am trying to create a file to unlink images whenever i need to delete them. Yesterday they were working and I am not sure what i changed in the last 24 hours that caused me to start getting errors.
The file, when it opened, wrote to it correctly, the problem seems to be creating it using fopen().
The code is as follows:
function create_unlink($uID, $filename){
$file1 = $uID.“unlink.php”;
$file = fopen($file1, 'w') or die("can't open file");
$data = "<?php\nunlink(\"$filename\");\n?>";
fwrite($file, $data);
fclose($file);
return $file1;
}
The error is: Warning: fopen(38unlink.php): failed to open stream: Permission denied in /net/homes.ict.griffith.edu.au/export/home/s2763543/public_html/wp/assign2/includes/defs.php on line 477 can’t open file
This file is being created in my base directory for the files, which has absolute permissions. I hope this is the right place to put this topic, any ideas?