I hope you can help me please with a big of "forward planning" we're considering.
We have just launched a new custom made script which we use for Support, when each
new Support ticket is opened it's inserted into a MySQL database and therefore
awaiting staff viewing. Immediately an email is sent to the user detailing their
unique ID, and a link to "open" their ticket from a user script which lets them
add replies to the ticket.
This is all working perfectly, but one thing that concerns me is they could post
loads of information, repeatidly, and therefore put strain on the server and MySQL
Is there a possible piece of code I can include in the script that would stop
multiple submissions to the same ID? Let's say ... 2 per hour? Not only for replying
a ticket they made, but from the original form too? Is it possible to "block" an IP
and echo out a message that they cannot submit a new ticket, or update one for the
required time:submission ratio?
that logic eludes me? say you block them for a min 2 hours posting a request withthe ticket Id. What if you reply right away (which would be cinsidered good service) and they reply to that (thanking you, or asking more questions?
I would be blocked.
But the answer is yes, set a time on the ticket machine the ticket ID and ip address. then check time differnce between posting
If I understand the situation correctly there are a number of fairly easy ways to prevent someone from over-posting. Probably the most obvious would be to simply timestamp the entries in the database. This way whenever you get a submission it takes only a small piece of logic to first check if that user has posted to this ticket within the last hour, two hours, whatever time frame you want. If the user has posted too recently you simply redirect them to an error page explaining the problem. The obvious trap to avoid here is to make sure that you are only blocking users from over-posting and not your support people.