How do I write to a file using php without chmoding it to 777. Isn't there a way to write to a file that isn't world writable? I never had this problem with Perl, it let you write to a file that was chmoded to 700.
Thanks in advance for your help =)
Depending on how your using the file, try 666.
I might as well chmod it to 777 because everybody on the server can still write to it when it's chmoded to 666.
PHP can also write to 700 files, providing that the webserver is the owner.
BTW this is equally true for PERL. In fact, no script or program can write to a 700 file if it is not the owner.