Hey guys.  I work for a company that does a lot of Asp.net work but for some 
reason we maintain this ColdFusion / MySql site for a business.  Well the 
current hosting service that the guy uses is no longer going to support 
ColdFusion so I was charged with the task of moving the website over to 
GoDaddy.  

I am by no means a ColdFusion person so I am really out of my element here.  
For the most part the transfer went smooth.  I downloaded all the files from 
the current spot where the site is hosted and uploaded them to the new 
location.   I then exported the MySql database to .sql using the phpAdmin tool. 
 Then I created a MySql database on GoDaddy and imported the sql file.  
Everything seems to have gone smoothly up to this point.  I fixed some 
relatively minor errors that were resulting.  But then when I went to add a 
product to the shopping cart I would get the "variable CFID is undefined" 
message.  Here is the temporary Domain that GoDaddy sets aside: 
http://emmrod.com.previewdns.com/.  When you click on a product and try to add 
it to shopping cart you will get that message.

I am confused as to why after moving from one hosting service to another I 
would start to get that error.  Is it because a different version of ColdFusion 
might be running the code now?  Like I said I am a ColdFusion newbie so 
everything I know is from what I managed to research about this on Friday.  
CFID and CFToken are basically cookies that ColdFusion automatically declares 
and sets when you initiate a new session.  But why aren't they now being set?

Here is some of the code from showcart.cfm and application.cfm if that helps.  
Any help at all with this would be much appreciated.  Thank you!



Application.cfm:

<cfsetting showdebugoutput="yes">
<cfapplication name="emmrod" sessionmanagement="Yes" 
sessiontimeout="#createtimespan(0,2,0,0)#">

showcart.cfm:

<cfparam name="url.action" default="">
<cfparam name="url.remove" default="">
<!--- add to cart section ---->
<cfif url.action eq "add">
        <cfparam name="form.products_extrainfo" default="">
        <cfparam name="form.products_extrainfo2" default="">
        <cfparam name="form.products_extrainfo3" default="">
        <cfparam name="form.products_extrainfoname" default="">
        <cfparam name="form.products_extrainfo2name" default="">
        <cfparam name="form.products_extrainfo3name" default="">
        <cfparam name="form.selectchoice" default="">
        <cfif len(form.selectchoice) gt 0>
                <cfquery datasource="mysqlcf_emmrod" name="getcolors">SELECT 
products_colors FROM products WHERE products_id = #form.products_id#</cfquery>
                <cfset form.selectchoice = listgetat(getcolors.products_colors, 
evaluate(form.selectchoice + 1))>
        </cfif>
        <cfquery datasource="mysqlcf_emmrod">INSERT into orders(orderItemID, 
orderDateTime, orderCustomer, orderQuantity, orderinfo1, orderinfo2, 
orderinfo3, orderinfo1name, orderinfo2name, orderinfo3name, selectchoice) 
        VALUES('#form.products_id#', #Now()#, '#cfid##cftoken#', 
#form.quantity#, '#form.products_extrainfo#', '#form.products_extrainfo2#', 
'#form.products_extrainfo3#', '#form.products_extrainfoname#', 
'#form.products_extrainfo2name#', '#form.products_extrainfo3name#', 
'#form.selectchoice#')
        </cfquery>
</cfif>

<cfif len(url.remove) gt 0>
        <cfquery datasource="mysqlcf_emmrod">DELETE FROM orders WHERE orderkey 
= #url.remove#</cfquery>
</cfif>

<!--- display cart --->
<table width="500" border="0" cellspacing="0" cellpadding="0">
        <tr><td align="Center" colspan="5"><h3>Shopping Cart</h3></td></tr>
        <TR>
                <TD align="center" colspan="5">
        <cfquery datasource="mysqlcf_emmrod" name="getOrder">SELECT * FROM 
orders WHERE orderCustomer= '#cfid##cftoken#' AND orderDateTime > 
#parsedatetime(dateadd("d", -1, now()))#   </cfquery>

                        <form 
action="index.cfm?page=showcart.cfm&action=update" method="post">         
                                <table width="98%" border="0" align="center" 
style="background-color : Silver; border : thin solid Gray;">
                  <tr> 
                    <td width="20%" height="21"><font color="#333333" 
face="Arial, Helvetica, sans-serif"><strong>Product</strong></font></td>
                    <td width="15%"><font color="#333333" face="Arial, 
Helvetica, sans-serif"><strong>Quantity</strong></font></td>
                                        <td width="25%"><font color="#333333" 
face="Arial, Helvetica, sans-serif"><strong>Info</strong></font></td>
                    <td width="20%"><font color="#333333" face="Arial, 
Helvetica, sans-serif"><strong>Price</strong></font></td>
                    <td width="20%"><font color="#333333" face="Arial, 
Helvetica, sans-serif"><strong>Subtotal</strong></font></td>
                  </tr>
                        <cfparam name="subtotal" default="0">
                  <cfoutput query="getOrder"> 
                    <cfquery name="specificproduct" datasource="mysqlcf_emmrod">
                    SELECT * from products WHERE products_id = #orderItemID# 
                    </cfquery>
                    <tr> 
                      <td><font color="##333333" face="Arial, Helvetica, 
sans-serif">#specificproduct.products_model# 
                        </font><br><font size="-2"><a 
href="index.cfm?page=showcart.cfm&remove=#orderkey#" onClick="return 
confirm('Are you sure you want to delete this from your 
cart?');">[remove]</a></font></td>
                      <td> <font color="##333333" face="Arial, Helvetica, 
sans-serif"> 
                       #orderQuantity#
                        </font></td>
                                                <td><font color="##333333" 
face="Arial, Helvetica, sans-serif" size="-2"> 
                                                <cfif len(orderinfo1name) gt 
0><strong>#orderinfo1name#:</strong> #orderinfo1#<br></cfif>
                                                <cfif len(orderinfo2name) gt 
0><strong>#orderinfo2name#:</strong> #orderinfo2#<br></cfif>
                                                <cfif len(orderinfo3name) gt 
0><strong>#orderinfo3name#:</strong> #orderinfo3#<br></cfif>
                                                <cfif len(selectchoice) gt 
0><strong>choice:</strong> #selectchoice#<br></cfif>
                                                </font>                         
                                                </td>
                      <td> <font color="##333333" face="Arial, Helvetica, 
sans-serif">#dollarformat(specificproduct.products_price)# 
                        </font></td>
                      <td><font color="##333333" face="Arial, Helvetica, 
sans-serif">

                                                #dollarformat(orderQuantity * 
specificproduct.products_price)#  
                        <cfset subtotal = subtotal + (#orderQuantity# * 
#specificproduct.products_price#)>
                                                
                        </font></td>
                    </tr>
                  </cfoutput> 
                  <tr> 
                    <td colspan="4" align="right">
                                                <font color="#333333" 
face="Arial, Helvetica, sans-serif"><strong>Subtotal: 
<cfoutput>#dollarformat(subtotal)#</cfoutput> </strong></font>
                                         </td>
                  </tr>
                                  <TR><TD colspan="4">&nbsp;&nbsp;</TD></TR>
                                  <cfif Subtotal EQ 0>
                                          <tr>
                                                <td colspan="4" align="right"> 
                                                        <h4><a 
href="https://www.emmrod.com/index.cfm?page=products.cfm";>No Items Ordered.  
Return to Products Page.</a></h4>
                                                </td>
                                          </tr>                           
                                  <cfelse>
                                          <tr>
                                                <td colspan="4" align="right"> 
                                                        <cfoutput><a 
href="https://www.emmrod.com/cart/index.cfm?page=orderpage.cfm&order=#cfid##cftoken#";></cfoutput><img
 src="images/checkout.gif" align="right" border=0 alt="Emmrod Checkout"></a>
                                                </td>
                                          </tr>
                                  </cfif>
               </table> 
        </form>
                </TD>
        </TR>
</TABLE>




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332832
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to