Modifying file permission usinga PHP script
Hi,We are writing a script. This script will need to write to a flat text file. Now, we ar facing a small problem, where i am stuck.
How do i ensure the security of the file and make it modifyable using this script. To write to a flat text file, we possibly need chmod 666. Now if i do that, i possibly make that file insecure.
What i have in mind:
When the edit is required, i chmod the file to 666 and save the file using the PHP script (the script will run under the account of the user whose account contains the files). Once the file is saved, we get back to the old chmod setting.
How is this possible in PHP. Can someone guide me please.
This script will NOT run from dedicated server. It will have to work from a shared hosting account without intervention fromthe root system admin.
Thankx for your help.
Regards
Abhishek