I did just that. Permissions are set the /chat folder as it is in all other
folders. This is the first time I've ever done fopen with "w" and I can't
get it to write, always getting "unable to access" errors. I want to be able
to create the file if it does not exist. It works for me to do "r" in all
other folders with the same permissions as /chat.
"Craig" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> you must give the same permissions to the folder also.
> "Phil Powell" <[EMAIL PROTECTED]> wrote in message
> Hi I have the following code that breaks:
> // PLACE NICK INTO NICKNAMES.TXT AND START OFF MESSAGES.TXT
> $fileID = fopen($path . "/nicknames.txt", "a") or die("Could not open "
> $path . "/nicknames.txt");
> chmod($path . "/nicknames.txt", 0755);
> fputs($fileID, $nickname . "\n"); fflush($fileID); fclose($fileID);
> $fileID = fopen($path . "/messages.txt", "a") or die("Could not open "
> $path . "/messages.txt");
> fputs($fileID, "*** WELCOME \"" . $nickname . "\" TO THE ROOM ***");
> fflush($fileID); fclose($fileID);
> I am getting the following error:
> Warning: fopen("/users/ppowell/web/chat/nicknames.txt", "a") - Permission
> denied in /users/ppowell/web/chat/chat.php on line 163
> I am attempting to write onto the files if they exist, if not, create them
> on the fly. I need the solution in the next 5 minutes - sorry, kind of an
> If anyone can help, please tell me what to do, the PHP manuals are not
> giving me a clear solution as to how to write to a file that does not yet
> exist that has to have the permissions of 0755 for both files.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php