Including files in ColdFusion is made simple with the <cfinclude> tag, which takes a
single attribute: template. The template attribute points to the file to include.
ColdFusion first looks for the included file relative to the current directory. If it cannot
find it, it then looks in directories mapped in ColdFusion Administrator.
Note that a ColdFusion tag cannot be opened in a calling file and then closed in
an included file or vice versa. The ColdFusion code in the included
file must be syntactically valid on its own.
A Note on Security
If included files are under the web root, they can be accessed just as any other file can. If
they have an extension such as .inc then the browser may display them as plain text.
With other extensions, the browser may attempt to download the file. If the included file is
a ColdFusion file and a user navigates to it, the server will try to process the file and may
return errors. As a precaution, you may want to place your included files in a directory
above or outside of the web root. This will prevent users from accessing the files directly.