Hi guys, what a weird thing thats happening. I am trying to create a script that will select a file it opens the index.php deletes the contents and uploads the new file and writes to the index.php. The crazy thing is if all files are placed in the root directory it works like a pc of cake if I attach it inside a folder chmod all the relevant files it comes with
Warning: fopen("./index.php","w+") - Permission denied in /home/creative/www/database/templateupload.php on line 5
Strange thing is if all files are placed in the root it works. Does anyone have any ideas whats going on in english terms? I have tried to change w in place of w+ still dont work....
Thanks
Joe
This is the main php script -
require("global.php");
$Open = fopen($TheFile, "w+");
$Open_toread = fopen($filetocopy , "r");
$contents = fread( $Open_toread , filesize( $filetocopy ) );
if ($Open) {
fwrite ($Open, $contents );
fclose ($Open);
$Worked = TRUE;
echo ("succesfuly");
} else {
$Worked = FALSE;
}
return $Worked;