cfml error with application.cfc page
I have some problem with my cfml website.
I have used the below开发者_开发百科 code in application.cfc file to connect with the dsn.
But when ever i put this in my server, i'm getting error. i cant browse even a single test.cfm page.
Is there any mistake in that code , any syntax error or something like that, will it be some problem with the dsn
<cfset this.name = "0307de6.netsolhost.com">
<cfset this.sessionmanagement = true>
<cfset this.loginstorage="session">
<cfset this.sessiontimeout = CreateTimeSpan(0,0,30,0)>
<cfset this.applicationtimeout = CreateTimeSpan(2,0,0,0)>
<cffunction name="onApplicationStart">
<cfscript>
application.DSN = "hirerodsn";
application.dbUserName = "myusr";
application.dbPassword = "myd69!";
</cfscript>
</cffunction>
<cffunction name="onRequestStart">
<cfscript>
request.DSN = "hirerodsn";
request.dbUserName = "myusr";
request.dbPassword = "myd69!";
</cfscript>
</cffunction>
please anyone help me
Please note that you should also post at least error messages in your questions.
Any way, your error here is that you have to enclose whole .cfc file contents inside cfcomponent tag:
<cfcomponent output="false">
...
</cfcomponent>
Also please note that you can set the username and password in datasource configuration, so you don't really need to handle them in your code (queries).
精彩评论