Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Orlando, FL

    PHP fopen() problem here.

    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?

  2. #2
    Probably you don't have the permission to write in that folder (ex. htaccess or public_html) or the folder has a different owner than the php file (under *nix).

  3. #3
    Join Date
    Apr 2003
    London, UK
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts