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()?