Forum Moderators: coopster
Yeah, but what I'm asking is if the server checks every included file that has a .php extension for executable scripting (whether it has script in it or not) before including it (or does the execution happen only after it's included)?
include() doesn't even look at the extension. It always loads the given file & parses it.
When a file is included, parsing drops out of PHP mode and into HTML mode at the beginning of the target file, and resumes again at the end. For this reason, any code inside the target file which should be executed as PHP code must be enclosed within valid PHP start and end tags [php.net].