I'm trying to make a very basic CMS for my website. I'm using forms to fill in all the information. Everything works upto the file creation. I know this because if I just say echo $page it will display exactly what I want. Here is the code that I'm using to write to a file:
$filename = $filename . ".php";
//Line 101
$filehandler = fopen($filename, 'w') or die("Can't Open File");
$fwrite($filehandler, $page);
fclose($filehandler);
I get this error:
Warning: fopen(myfile.php): failed to open stream: Permission denied in /home/dvdswapn/public_html/domicile/contribute/finished/submit.php on line 101
Can't Open File
From my understanding, I need to use chmod. So I used CuteFTP and changed the permission to 777 for the "/finished" folder. I still get the same error and when I go back into check the permissions, it is back to its original setting (not 777). I was thinking that maybe it had to do with me trying to create a php file, but I changed it to txt and it still didn't work. Can someone tell me what I am doing wrong?