• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Safer Includes

One of the beauties of creating dynamic sites is the ability to take advantage of server-side includes. Similar to an external JavaScript file, the code calls the file to be included on a page. When an update is needed, only the single include file needs be updated and uploaded to affect all files that reference it. The biggest mistake you can make using includes is one you may never have considered: your file-naming convention. Many developers like to use an .htm or .inc file extension to help them easily identify the files as an include file. Although it is acceptable to use .inc or .htm as file extensions, if they are found on the server, they could expose server-side code that you would not want users to have access to. Either be certain that these files do not contain server-side code, or use your server language’s file extension (.asp, .cfm, .php, and so forth) for the include files. To help you identify the files easily in your site as includes, you may want to put all of your include files in a folder called Includes or name the files with an inc prefix, such as incFooter.asp.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint