application.cfc 页面出现 cfml 错误
我的 cfml 网站有一些问题。
我在 application.cfc 文件中使用了以下代码来连接 dsn。
但是当我将其放入我的服务器时,我会收到错误。我什至无法浏览一个 test.cfm 页面。
该代码中是否有任何错误,任何语法错误或类似的错误,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>
请任何人帮助我
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请注意,您还应该在问题中至少发布错误消息。
无论如何,这里的错误是您必须将整个 .cfc 文件内容包含在 cfcomponent 标记中:
另请注意,您可以在数据源配置中设置用户名和密码,因此您实际上不需要在您的代码(查询)中处理它们。
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:
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).