So I've done some pretty hacky things with Drupal, one of them being for simple data requests.
For example, say I have a simple form that asks for a registration ID number. This ID number is saved in a non-Drupal table in the same database. All I want my script to do is return whether or not that ID number is valid or whatever operation, but all I need to return is a string of "true" or "false" on an Ajax call that is called when the ID form field is blurred.
We don't have access to modules, so just adding in our own isn't an option, and we run on a multi-site environment, so adding a php file to our themes folder ends up becoming a terribly long string.
One thing I have done in the past is just create a new basic page and then use a php script in the page area to die("true"); but that always just feels so hacky.
My end goal would be to find some way to use drupals router and just print something without building a whole page around it, and I'm not exactly sure how I would be able to go about that.
Edit: also sometimes when I die("some text") in a basic page in Drupal that "some text" will appear in every page in the footer, even on pages where it shouldn't even be getting anywhere near the die("some text"); line. Why does this happen in Drupal?