Results 1 to 2 of 2
  1. #1
    Abina's Avatar
    Abina is offline Master
    Join Date
    Dec 2009
    Location
    United States
    Posts
    1,073
    Thanks
    1
    Thanked 6 Times in 4 Posts
    Feedback Score
    0

    Default Change web server Cause code not working

    Can anyone help me in correct this code so it can work with new server? (This was worked fine with previous web server).

    Code:
    <cfsilent>
    
    <!--- Set location for highlighting in Nav Menu --->
    <cfset strSelectNav = "Options">
    
    <!--- Set Local Variable for currently selected option --->
    <cfparam name="URL.optionID" default="0">
    <cfparam name="ThisOption" default="#URL.optionID#">
    
    <!--- Set Page Archive Status --->
    <cfparam  name="URL.OptionView" default="0">
    
    <!--- Set default Action value --->
    <cfparam name="FORM.action" default="">
    
    <cfif isdefined ("FORM.action") AND FORM.action EQ "DisplayProducts">
    
    	<cfquery name="qGetSelectedProducts" datasource="#request.dsn#">
    		SELECT *
    		FROM prod_table, prdtthrdcat_rel
    		WHERE prod_table.product_ID = prdtthrdcat_rel.prdt_thrd_rel_Product_ID
    		AND prdtthrdcat_rel.prdt_thrd_rel_ThrdCat_ID = #FORM.thrdctgry_ID#
    	</cfquery>
    	
    	<cfset SelectedProducts = ValueList(qGetSelectedProducts.product_ID)>
    
    </cfif>
    
    
    <cfif isdefined ("FORM.action") AND FORM.action EQ "UpdateProducts">
    
    	<cfquery name="qDeleteProducts" datasource="#request.dsn#">
    		DELETE FROM prdtthrdcat_rel
    		WHERE prdt_thrd_rel_ThrdCat_ID = #FORM.thrdctgry_ID#
    	</cfquery>
    	
    	<cfif isdefined ("FORM.Product_ID")>
    	
    		<CFLOOP LIST="#FORM.Product_ID#" INDEX="ThisProduct">  
    	
    			<cfquery name="qInsertProducts" datasource="#request.dsn#">
    				INSERT INTO prdtthrdcat_rel
    				(prdt_thrd_rel_Product_ID, 
    				prdt_thrd_rel_ThrdCat_ID)
    				VALUES
    				(#ThisProduct#,
    				#FORM.thrdctgry_ID#);
    			</cfquery>
    	
    		</cfloop>
    		
    	</cfif>
    
    </cfif>
    
    <!--- Get Record --->
    
    	<cfquery name="qGetCats" datasource="#request.dsn#">
    		SELECT *
    		FROM prdtcategories, prdtscndcats, prdtthrdcats
    		WHERE prdtcategories.category_ID = prdtscndcats.category_ID 
    		AND prdtthrdcats.scndctgry_ID = prdtscndcats.scndctgry_ID
    		ORDER BY prdtcategories.category_ID, prdtscndcats.scndctgry_ID
    	</cfquery>
    	
    	<cfquery name="qGetProducts" datasource="#request.dsn#">
    		SELECT *
    		FROM prod_table
    		Where Product_ID=Product_ID
    	</cfquery>
    	
    	<cfquery name="qGetThrdCats" datasource="#request.dsn#">
    		SELECT DISTINCT prdt_thrd_rel_Product_ID
    		FROM prdtthrdcat_rel
    	</cfquery>
    	
    	<cfset ProductList = ValueList(qGetThrdCats.prdt_thrd_rel_Product_ID)>
    
    </cfsilent>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Sofa World Admin</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link href="assets/admin.css" rel="stylesheet" type="text/css">
    </head>
    <body> 
    
    <!--- Include Admin Navigation Menu---> 
    <cfinclude template="CWIncNav.cfm">
    <div id="divMainContent"> 
    
    			<cfform name="Add" method="POST" action="#Request.ThisPageQS#" enctype="multipart/form-data">
                  <p><strong>Please select the  category you would like to view. <br>
                  You can then select all the ranges you wish to add to that category.<br>
                  <br>
                  If you need to add a new category, please do so by selecting 'Type Cats' from the Sub Categories menu on the left hand side </strong><br />
                    <br />
                    
                    <cfparam name="FORM.category_ID" default="0">
                    <cfparam name="FORM.scndctgry_ID" default="0">
                    <cfparam name="FORM.thrdctgry_ID" default="0">
                  </p>
                  <CF_ThreeSelectsRelated
    				  QUERY="qGetCats"
    				  NAME1="category_ID"
    				  NAME2="scndctgry_ID"
    				  NAME3="thrdctgry_ID"
    				  VALUE1="category_ID"
    				  VALUE2="scndctgry_ID"
    				  VALUE3="thrdctgry_ID"
    				  DISPLAY1="category_Name"
    				  DISPLAY2="scndctgry_Name"
    				  DISPLAY3="thrdctgry_Name"
    				  DEFAULT1="#FORM.category_ID#"
    				  DEFAULT2="#FORM.scndctgry_ID#"
    				  DEFAULT3="#FORM.thrdctgry_ID#"
    				  EMPTYTEXT1="-- Select --"
    				  EMPTYTEXT2="-- Select --"
    				  EMPTYTEXT3="-- Select --"
    				  SIZE1="1"
    				  SIZE2="1"
    				  SIZE3="1"
    				  WIDTH1="150"
    				  WIDTH2="150"
    				  WIDTH3="300"
    				  MULTIPLE3="No"
    				  ONCHANGE="this.form.submit();">
    				  <br />
    				  <br />
    				<input name="action" type="hidden" value="DisplayProducts">
    				
    				<cfif isdefined ("FORM.category_ID")>
    				
    					<cfquery name="qGetCat1" datasource="#request.dsn#">
    						SELECT *
    						FROM prdtcategories
    						WHERE category_ID = #FORM.category_ID#
    					</cfquery>
    					
    					<cfif qGetCat1.RecordCount NEQ 0>
    						<strong>Current selection:</strong> <cfoutput>#qGetCat1.category_Name#</cfoutput> >
    					</cfif>
    					
    				</cfif>
    				
    				<cfif isdefined ("FORM.scndctgry_ID")>
    				
    					<cfquery name="qGetCat2" datasource="#request.dsn#">
    						SELECT *
    						FROM prdtscndcats
    						WHERE scndctgry_ID = #FORM.scndctgry_ID#
    					</cfquery>
    					
    					<cfif qGetCat2.RecordCount NEQ 0>
    						<cfoutput>#qGetCat2.scndctgry_Name#</cfoutput> >
    					</cfif>
    					
    				</cfif>
    				
    				<cfif isdefined ("FORM.thrdctgry_ID")>
    				
    					<cfquery name="qGetCat3" datasource="#request.dsn#">
    						SELECT *
    						FROM prdtthrdcats
    						WHERE thrdctgry_ID = #FORM.thrdctgry_ID#
    					</cfquery>
    					
    					<cfif qGetCat2.RecordCount NEQ 0>
    						<cfoutput>#qGetCat3.thrdctgry_Name#</cfoutput>
    						<cfoutput>#qGetCat3.thrdctgry_ID#</cfoutput>
    					</cfif>
    					
    				</cfif>
    				<br /><br />
    			</cfform>
    			
    			<cfif isdefined ("FORM.action") AND FORM.action EQ "DisplayProducts">
    				
    				<cfform name="UpdateProducts" method="POST" action="#Request.ThisPageQS#">
    				
    					<cfif qGetProducts.RecordCount NEQ 0>
    						<strong>Here is a list of all the ranges you have added to the site.<br>
    Tick the ones you would like added to the current category and click Submit.
    						<cfoutput query="qGetProducts"></cfoutput></strong><cfoutput query="qGetProducts">
    							<table width="500" border="0" cellspacing="0" cellpadding="0">
    							  <tr>
    								<td width="334" nowrap>#product_Name#</td>
    								<td width="28">
    									<input name="Product_ID" type="checkbox" value="#product_ID#" 
    									<cfif isdefined ("SelectedProducts") AND ListFind(SelectedProducts, Product_ID)> 
    										checked="checked"
    									</cfif>>
    								</td>
    			<td width="136" nowrap>
    								<cfset RelatedProduct = ListContains(ProductList, product_ID)>
    									<cfif RelatedProduct EQ 0> 
    										&nbsp;Range not in a category!
    									<cfelse>
    										&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    									</cfif>
    								</td>
    	  </tr>
    	</table>
    	  </cfoutput>
    						
    	<input name="thrdctgry_ID" type="hidden" value="<cfoutput>#FORM.thrdctgry_ID#</cfoutput>">
    	<input name="action" type="hidden" value="UpdateProducts">
    		<input name="Go2" type="submit" value="Submit">
    				
    		</cfif>
    	
    		</cfform>
    			
    	</cfif>
    </div> 
    
    </body>
    </html>

  2. #2
    numberone's Avatar
    numberone is offline Senior
    Join Date
    Jan 2010
    Posts
    623
    Thanks
    0
    Thanked 1 Time in 1 Post
    Feedback Score
    0

    Default

    1.) Make sure Sandbox is enabled as you don't have your USERNAME or PASSWORD set in your <cfquery>
    2.) I noticed you are using REQUEST. I would try to set your variables in the App.cfc file.

    This is how I do it.

    <cfset application.datasource = StructNew() >
    <cfset application.datasource.datasource = "datasource">
    <cfset application.datasource.username = "username">
    <cfset application.datasource.password = "password">

    The username and password are tied into your database... eg.) what you would use to login to access your database via.) MySQL or whatever.

    If you do not know your username or password contact your host, but you should know it

    Another thing I found odd was you used cfform and then you used regular HTML for the form. That makes no sense what so ever to me.

    Well I hope I helped you at least a fraction. Take care.

Similar Threads

  1. Basic html tutorial
    By Richaexpert in forum Graphics Design & Web Design
    Replies: 26
    Last Post: 08-11-2011, 02:53 AM
  2. Replies: 1
    Last Post: 02-02-2010, 11:18 AM
  3. Please, I need advice on which Server to get for work
    By bluewhale in forum Windows Server
    Replies: 0
    Last Post: 01-06-2010, 10:27 AM
  4. Manage your server isn't working?
    By bluewhale in forum Windows Server
    Replies: 0
    Last Post: 01-06-2010, 10:25 AM
  5. Windows Server 2008 Delivers Web-based Experiences
    By shovakoirala in forum Windows Server
    Replies: 7
    Last Post: 12-11-2009, 05:49 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Partners: BOSTON WEB DEVELOPER, LLC   |   WEBCOSMO CLASSIFIEDS