home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 139 / dpcs0999.iso / Web / CFserver / data1.cab / Documentation / snippets / viewexample.cfm < prev    next >
Encoding:
Text File  |  1999-04-12  |  585 b   |  18 lines

  1. <CFSET thistag="">
  2. <CFPARAM name="variables.file_dir" default="#getDirectoryFromPath(GetTemplatePath())#">
  3. <CFPARAM name="variables.file_name" default="#lcase(trim(tagname))#.cfm">
  4.  
  5.  
  6. <CFSET variables.file_name = rereplacenocase("#variables.file_name#", "[\\\/]", "", "ALL")> 
  7. <CFSET variables.file_name = rereplacenocase("#variables.file_name#", "\.{2,}", "", "ALL")> 
  8. <HTML>
  9. <BODY  bgcolor="#FFFFD5">
  10. <CFFILE ACTION="READ" FILE="#file_dir##file_name#" VARIABLE="thistag">
  11. <H2>Sample code</h2>
  12. <HR>
  13. <CFOUTPUT>
  14. #HtmlCodeFormat("#thistag#")#
  15. </BODY>
  16. </CFOUTPUT>
  17. </HTML>
  18.