After further testing, it seems to be a very strange error, although I still haven't figured it out. When the PHP file renders, the output doesn't work properly (it throws the Javascript function not found error). Interestingly enough, if the HTML (as received by the browser) is copied and pasted in...