I own quite a popular arcade/games website that allows people to submit game requests via an input box. Currently, an email is sent to my seperate inbox with the game request as the message, I then add write this manually to requests.txt file and put if the game will be added or not and a few days later add it to the website.

I am looking for a solution that will add the game names onto a requests file automatically everytime someone submits a request. It must have a badword filter and not be a large file.

For example, if I wanted the game 'deanimator' to be added, I'd type it in the text box, press submit, it would be automatically added to a file with the message 'Request Pending' next to the request. I would then add the games manually to the website itself.

Sorry if my english is bad,
L.

    Well, a bad-words filter is nothing more than a pretty-good regular expression (google for one). As an alternative you can create an array of bad-words you want to censor and then do an [man]in_array/man or [man]str_replace/man to replace the bad-words with whatever you want.

    Then to add them to a file, you would want to append the data, so you would use [man]fopen/man with the "a" mode option (or "a+").

    That's really all there is to it.

      Write a Reply...