here is my code

Application.cfm
---------------
<CFSET directorypath ="/home/auto1/autocomm-inc.com/html/dev/">
<CFPARAM name="session.LoggedIn" DEFAULT="FALSE">

x_addtest.cfm
-------------
<cfquery datasource="autoadmin" name="InsertTest">
                INSERT INTO testimonials(
                
tfeature,biz_name,test_name,test_pos,trank,tindustry,display,test_desc,displayscroller,tfeature2)
                VALUES (
                
'No','#form.biz_name#','#form.test_name#','#form.test_pos#',#form.trank#,'#form.tindustry#','#form.display#','#form.test_desc#','#form.displayscroller#','#form.tfeature2#');
        </cfquery>
        
        <cfquery datasource="autoadmin" name="GetLast">
                 SELECT MAX(test_id) as lastID
                 FROM testimonials
                 WHERE biz_name = '#form.biz_name#'
        </cfquery>
        
        <cfif isdefined('form.timage1')>
                <cfif #form.timage1# NEQ ''>
                <cffile action="upload"
                  destination="#directorypath#images/apps/"
                  nameconflict="makeunique"
                  filefield="timage1"
                  mode = "777"
                  accept="image/*">
                
                <cfquery name="Update1" datasource="autoadmin">
                        UPDATE testimonials
                        SET timage1 = '#ServerFile#'
                        WHERE test_ID = #GetLast.lastID#
                </cfquery>
                </cfif>
         </cfif>
         
        <cfif isdefined('form.timage')>
                <cfif #form.timage# NEQ ''>
                <cffile action="upload"
                  destination="#directorypath#images/signboar/"
                  nameconflict="makeunique"
                  filefield="timage"
                  accept="image/*">
                
                <cfquery name="Update" datasource="autoadmin">
                        UPDATE testimonials
                        SET timage = '#ServerFile#'
                        WHERE test_ID = #GetLast.lastID#
                </cfquery>
                </cfif>
         </cfif>
        
        
    <!-- Warn users -->
    <SCRIPT LANGUAGE="JavaScript">
      alert('You successfully added the Testimonial.');
    </SCRIPT>

    <SCRIPT LANGUAGE="JavaScript">
      self.location ='admin_test.cfm?type=testimonials';
    </SCRIPT>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:184181
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to