Jump to content

Using PHP to Create Flat Files


Recommended Posts

I am attempting to create a content management system. To do this, I want to be able to create flat files on my server. I am using touch() and fopen() to do this. (I would use file_put_contents(), but my server only has PHP 4.*.)Anyway, the problem that I am encountering is that using a PHP script to create an HTML file on my server causes the file's owner to be "nobody." And since the owner is "nobody", then I cannot delete it from the server. I have to write a whole new script just to delete files I created.I thought I would use chown() to change the owner of the file to my FTP user, but I'm not allowed to use chown() on my server. I also can't use passthru() or chmod(). And yet CMS scripts create files all the time! What am I missing?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...