Ways around fwrite() block on a host server?

I’m having some difficulties on a free host server that I don’t normally run into on my own privately run server. My hosting site blocks the use of writing files (blocks the fwrite() function, to be specific), and that’s the way I’ve always “logged” activity on my website…

What I want to accomplish: I’ve created a public website as a tool to submit a discussion post to the website Reddit where any user who wishes to post it, can! However, at the same time, I want to limit it so that it can only be submitted ONCE, by any and all users.

How I would normally accomplish this: I would normally create a .txt or some other file file that would be saved, such as “submitted.txt” with “1” as the contents, or something more specific that I won’t get into right now. This way, the next time someone attempts to submit, the first thing is to see if “submitted.txt” exists, and if it does, it denies the next user.

The problem I’m having: My hosting website does not allow PHP to WRITE to any files on the server. So I am unable to change anything on the server based on a user’s action. I need to find some other way of logging that an event had occurred using the website without needing the use of fwrite().

The twist: I’m probably going to get flack for this, but I don’t “trust” databases. I haven’t really learned an extensive amount about databases (like MySQL), but I know how they work (and think they’re amazing), but for some reason I don’t trust that the data will remain in tact in the event of something unforseeable (random server outage or something), etc. I don’t know how to explain it, really. I just trust that a “hard copy” (file) is more trustworthy than a database (memory).

My question: Is there a way I can log an event on my website that can be referenced later without the use of databases or fwrite()?

Please help! :slight_smile:

I don’t mean to sound flippant but move to another host?
There are loads out there so choice is not a problem. I know from experience years ago the hosts i used allowed me to write to files. (I have my own hosting business now and I allow it, so I don’t get what the issue is with your current host? - and before you want to come and join me, you’re more than welcome, but my free hosting is limited to 25mb space so not ideal, but hey, it’s free!)

This made me smile… ;D

Red. :wink:

Sponsor our Newsletter | Privacy Policy | Terms of Service