Well, that is not exactly true. You can call <cfapplication> in any of your
templates, but only once per site. You can put it in a file for processing
your global site vars and call that file from within your index.cfm file if
you wish. CF simply traverses up your sites files until it reached your root
directory and if does not find your <cfapplication> it just does not use it.
IE:
site_globals.cfm
<cfapplication name="myApp"
sessionmanagement="yes"
clientmanagement="yes"
sessiontimeout="#createTimeSpan(0,0,20,0)#">
<cfset application.dsn = "myDsn">
<cfset application.adminEmail = "myAdminEmail">
index.cfm
<cfinclude template="site_globals.cfm>
more code....
----- Original Message -----
From: "Rick Root" <[EMAIL PROTECTED]>
To: "CF-Talk" <[email protected]>
Sent: Friday, November 10, 2006 7:55 PM
Subject: Re: Code Question
> Jason T. Slack wrote:
> >
> > <CFAPPLICATION NAME="mysession" SESSIONMANAGEMENT="Yes"
> > SESSIONTIMEOUT="#CreateTimeSpan(0, 0, 20, 0)#">
>
> PRoblem #1: <cfapplication> ONLY goes in a file called Application.cfm
>
> The application.cfm is processed on EVERY coldfusion request.
>
> Problem #2: <!--- successful login -->
>
> You've combined a CFML open comment ("<!---") with a standard HTML
> comment end "-->")
>
> Problem #3 - ALWAYS USE CFQUERYPARAM in your queries.
>
> so replace your variable parameters in the query with cfqueryparam tags,
> like this:
>
> <cfquery name="ckCreds" datasource="#MyDSN#">
> SELECT LocationName FROM
> WHERE LocationID = <Cfqueryparam cfsqltype="cf_sql_varchar"
> value="#form.user#">
> AND LocationPassword = <cfqueryparam cfsqltype="cf_sql_varchar"
> value="#form.password#">
> </cfquery>
>
>
> Just get used to using cfqueryparam now and it will save you a LOT of
> grief later. It improves performance and enhances security - eliminates
> the possibility of SQL injection.
>
> Rick
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:259985
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4