Coldfusion 8 - > 9更新,功能不再有效

时间:2012-08-11 02:11:45

标签: variables coldfusion coldfusion-9 coldfusion-8 application.cfc

HELP !!

只是将网站从一台服务器迁移到另一台服务器,coldfusion版本正在从cf8更改为cf9 [linux / centos]

此代码之前曾用过:

cfinclude('../SQL/contact.sql.cfc');
form.phone = unFormatPhone(form.phone);
contactID = InsertContact(form);

在包含的文件中是:

<cfcomponent output="false" >
<!--- -------------------------------- insert -------------------------------- --->
<cffunction name="InsertContact" returntype="numeric" output="false" access="public" >

现在我在浏览页面时遇到错误:

Variable INSERTCONTACT is undefined.


The error occurred in /var/www/vhosts/xxxxxx.com/httpdocs/Assets/XHTML/buy-my-car.cfm: line 54
Called from /var/www/vhosts/newride.ca/httpdocs/Application.cfc: line 232
Called from /var/www/vhosts/newride.ca/httpdocs/Application.cfc: line 230
Called from /var/www/vhosts/newride.ca/httpdocs/Application.cfc: line 162
52 :            cfinclude('../SQL/contact.sql.cfc');
53 :            form.phone = unFormatPhone(form.phone);
54 :            contactID = InsertContact(form);
55 :            
56 :            //insert vehicle with app id

这里发生了什么?正在找到包含的文件,这两个版本之间是否存在一些差异?

2 个答案:

答案 0 :(得分:3)

好吧,首先我会说我只使用CF9,所以我不能评论你曾经在CF8中做过什么。但是,在CF9中,我很确定你不能以这种方式使用CFC。与您正在进行的操作最接近的是使用<cfinvoke>的临时调用。见这里:http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-7db3.html

但是,还要看一下将cfc实例化为一个对象,然后调用该对象上的方法。我喜欢这样做,因为它让我想起了Java和C#等其他语言。

答案 1 :(得分:3)

你确定它被收录了吗?尝试:

include "../SQL/contact.sql.cfc";
form.phone = unFormatPhone(form.phone);
contactID = InsertContact(form);