home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1999 April / APC443.iso / features / grpware / coldfus / coldfusi.exe / data1.cab / Documentation / snippets / cfapplication.cfm < prev    next >
Encoding:
Text File  |  1998-10-08  |  1.5 KB  |  48 lines

  1. <!--- This is a view-only example to illustrate
  2. CFAPPLICATION --->
  3. <HTML>
  4. <HEAD>
  5. <TITLE>CFAPPLICATION Example</TITLE>
  6. </HEAD>
  7.  
  8. <BODY>
  9. <H3>CFAPPLICATION Example</H3>
  10.  
  11. <P>CFAPPLICATION defines scoping for a Cold Fusion application
  12. and enables or disables the storing of client and/or session
  13. variables.  This tag is placed in a special file called
  14. application.cfm that is run before any other CF template in
  15. a directory where the application.cfm file appears.
  16. <P>Here is a read-only listing of a typical application.cfm file:
  17.  
  18. <CFOUTPUT>
  19. #HTMLCodeFormat("
  20. <!-- Begin Application -->
  21. <!---
  22.     MODULE:            application.cfm
  23.     PURPOSE:        application.cfm file for our sample
  24.     CREATED:         today's date
  25.     AUTHOR:            the author
  26.     COPYRIGHT:        (c) 1998 the author for a company
  27.     CHANGE HISTORY: 
  28. --->
  29. <!--- name application, set session variables to on --->
  30. <CFAPPLICATION NAME='GetLeadApp' SESSIONMANAGEMENT='Yes'>
  31. <!--- set datasource for this application --->
  32. <CFSET dsn = 'my_dsn'>
  33. <!--- set global error handling for this application --->
  34. <CFERROR TYPE='REQUEST' TEMPLATE='request_err.cfm' MAILTO='webmaster@mysite.com'>
  35. <CFERROR TYPE='VALIDATION' TEMPLATE='val_err.cfm' MAILTO='webmaster@mysite.com'>  
  36.  
  37. <!--- set some global variables for this application to
  38. be triggered on every template --->
  39. <CFSET MainPage = 'default.cfm'>
  40. <CFSET session.current_location = 'Davis, Porter, Alewife'>
  41. <CFSET sm_location = 'dpa'>
  42. <CFSET current_page = '#cgi.path_info#?#cgi.query_string#'>
  43. <!-- End Application -->
  44. ")#</CFOUTPUT>
  45.  
  46. </BODY>
  47. </HTML>       
  48.