Hey guys, I'm writing a news script that involves writing a file that doesn't exist yet, and also appending to a file that does exist. I have set 'w' mode for each fwrite() function, and I'm still having troubles writing to the files.
For the existing file, I had to CHMOD the folder and files with more permissions, and it worked, but for some reason it still won't create the other file.
Can someone please explain what settings or anything else I need to change so that PHP will also create the new file, along with appending to the existing one?
The error message(s) you're getting (if any) would be useful. Though you realise that the w condition will open and point to the beginning of the file? so in the file you want to ammend you might want to use 'a' instead which would open and point to the end of the file, for writing after any existing content.