I have a php script in my application, this script should be triggered only by a js script from my application. Actually, I'm trying to convert js errors to php errors, so I intercept js errors and send them to a php script. The problem with this approach is that then anyone is able to use the php script as well (and possibly spam the service).
I'm looking for a general approach here or for ideas to make a secure service.
So far, I found those options:
create a unique php key that one (the js script) must send in order to "post" an error to the php script. That's my best option for now, but unfortunately, so far, no matter how complex my key, or logical secure system is, I cannot find a 100% "uncrackable" solution (I can make it pretty hard for a potential spammer though).
use the html5 FileSystem api, but the problem is that the files that we can write to are browser dependent. And then maybe watch for changes in those files, and notify php when a change is made.
Do you have other ideas in mind ?