Do I understand this right???!!
You want the public surfer to change your file permissions via a PHP script using chmod???
Or don“t you know how to change it yourself???
Another question: Do you run your server at your own, or do you have an ISP???
The most secure version would be as follows:
As owner of the server, change the owner of the file to the owner who can start the server. Now the server process can do anything with the file (the folks behind their browsers do nothing (never!), PHP/Apache always writes to the file!!).
A rather bad workaround would be:
If you are not owner of the server, change the file to 777. Now everyone can access it (including the server process to write to it)... get the point???
Better: Ask your ISP to include the server process to the group the users (like you) belong to. So you can give write permissions to 'group'.
Not really save (but heaps better), since other users of the server might..... you know what I mean???
Hope that helped someway.....
FAB