Is there any way to prevent a user from writing code to include a php file if they have access to the server? I can't use a .htaccess deny from all type solution because as I understand it that is only for remote access. I also can't use a solution like the ones described here link from Tyler Carter because I process all pages from one central call which includes the appropriate page parts. Thus, $_SERVER['PHP_SELF'] always returns the same file, and I can't get the FILE of the calling script in the called script. So neither of those work.
I simply want to prevent the parts I include in the central file not to themselves call other files on the server outside their own directory.
I hope I am missing something and that this can be accomplished with .htaccess?
I guess a bigger question is if this is even a worthwhile security endeavor?