Forum Moderators: coopster
I have a page that uses 'include' statements to call a script for email handling. The two includes are in separate 'if' conditionals, one right after the other.
It works fine if only one of the includes fires, but if both are called, the page stops at the second include.
Am I better off just calling it once, at the very start of the page (before all conditionals), or does it need to be called at the line it's used? If the latter, how do I handle this error?
include_once() and require_once() behave exactly the same as include() and require() except they check the file they are including and ignore it if it has already been included.
Couple of things to note though,
* require() and require_once() throw fatal errors if the include fails, where as include() and include_once() only through a warning and the script execution continues.
* the *_once() commands can be slower because they have to check the files, but it is barely noticeable