I have a little bit of a confusing situation 🙂
I have a JavaScript function which is called by a few different pages. This JavaScript page then calls some server-side PHP code. About 98% of the time, there is no problem.
But sometimes the JavaScript does not pass an id parameter that it is supposed to, and that generates errors.
My problem is that I can not track down the page which makes the call to the JS function which then generates the PHP call with the error.
Any idea how I could track this down?
When your PHP script does its work, send the
HTTP_REFERRERto the error log. Add the date & time, and$_GETvars for more info. This info should already be in your web server access log, but if you need the$_POSTvars too you’ll want to create a custom message into the error log.