Sorry for the dramatic sounding title, just wanted to know if there is a way to prevent all types of PHP commands from executing EXCEPT one.
For example, now when I kill a script using die() my pages look half broken because the bottom part of the page’s html failed to load since it was being brought in using the include() function.
So is there a way to tell PHP “don’t allow any more commands to be executed except the include function” ?
You’re going to need to use a custom die() command, such as my_die() to include the needed files. You cannot override die() nor will any other function allow you to do what you seek.