ColdFusion Language

9K

Solutions

13

Articles & Videos

3K

Contributors

ColdFusion is a server-side rapid application development platform originally created by Allaire and now sold by Adobe, implementing the dynamic general purpose CFML programming language. The term ColdFusion is sometimes colloquially used to refer to the CFML language (Cold Fusion Markup Language), but can also include discussions of the server software implementation. ColdFusion runs using a customised version of Apache Tomcat. Earlier versions are bundled with JRun.

Share tech news, updates, or what's on your mind.

Sign up to Post

Good Afternoon, I would like to get some assistance with something I'm trying to do. I have a query that queries a table and gets various project information from that table, and it works fine. I have another table that has many comments about each project, so I have a one to many situation. My problem is that all UI want to retrieve from that second table is the last comment entered. I store the date of the last comment so I thought I would be able to do some sort of retrieval with a max date but not sure how to go about it. Ultimately I'm building a spreadsheet so the query is being built to populate the spreadsheet. Everything works fine till I had the 'proj_reason_closed' field. That the field that has many entries for each project.

SELECT DISTINCT proj_no,
spl,
capces_location,
capces_state,
capces_description,
maxdate,
proj_closed_reason,
ob_date_sort

FROM  (SELECT DISTINCT

       current_bulk_filter.proj_no,
       current_bulk_filter.capces_location,
       current_bulk_filter.capces_description,
       current_bulk_filter.capces_state,
       current_bulk_filter.spl,
       capces_support_data.ob_date_sort,
       spend_plan_history.proj_closed_reason,
       x2.maxdate

      FROM   mca.current_bulk_filter

left join mca.spend_plan_history
        ON ( current_bulk_filter.proj_no = spend_plan_history.proj_no and
             )

WHERE ......
0
Monthly Recap
Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

I have a Cold Fusion form with a contract number field that needs more than one label. Current code is:

<label for="Contract_Number">Contract Number:&nbsp;</label>

Open in new window


How do I add another id so I can use the same validation for that form field? Would this work:

<label for="Contract_Number" for="Contract_NumberZ">Contract Number:&nbsp;</label>

Open in new window


Or how do I add the 2: This doesn't seem to work:

label for="Contract_Number"|"Contract_NumberZ">

Open in new window


thanks
0
is it possible to set up a regex to validate each position in a string of characters in a form field?

I have a requirement for a contract number field in a Cold Fusion form. Requirements are:

•      Positions 1-6 will be the  70Z0XX where XX is the contracting office code IE: 23.
•      Positions 7-8 will be the two digit Fiscal Year IE: 17.
•      Position 9 will be the one character instrument code IE: C, D, F.
•      Positions 10-17 will be agency assigned number.
•      New Example: 70Z02317D00000001

Is it possible to set up an expression at different points w/in the string of characters? I've never done that...only length requirements and forcing it to start w/ either a number or a letter. thanks for any help.
0
I want to keep cookies alive even after restarting Coldfusion on the server each morning.  Screen-Shot-2017-06-21-at-8.51.25-AM.pngI am attaching the settings from Coldfusion.

Thanks for your help
0
I have one form field with a Cold Fusion form that is requiring 2 different sets of criteria for validation....can this be done?

I have 2 sets of criteria for a contract number field w/in a CF form field. One is requiring the contract number to begin with a numeric character the other alphanumeric. I currently have the one set that needs to start w/ a letter but need to add the validation using a regex to the same form field to trigger the field to validate for the additional set of criteria that requires the new contract number configuration to begin with a number.

Current setup for the validation is:

			, Contract_Number: {
				required: true
			   ,pattern: /^[DdFfGgHhNnVv][A-Za-z0-9]{1,21}$/

Open in new window


Form field setup:

                        	<font face="Arial" size="2" color="#990000">
                            <label for="Contract_Number">Contract Number:&nbsp;</label>
							 <input type="text" name="Contract_Number" id="Contract_Number" minlength="8"  maxlength="22" tabindex="7" value="<cfif structkeyexists(session.invoiceDataContr, "PASS")><cfoutput>#session.invoiceDataContr.Contract_Number#</cfoutput><cfelse><cfoutput>#form.Contract_Number#</cfoutput></cfif>" required/>
                        	<font size="1" color="navy" title="No hyphens or special characters, OF-347 block 2, SF-26 block 2, SF-1442 block 4, SF-1449 block 2, SF-33 block 2">(help)</font></font>

Open in new window


Is there a way to use a hidden field maybe? I'm not sure its even possible to do. This will need to use jquery for client but also needs server side validation as well.

I'm thinking I can use as try catch and w/in that use a cfif/cfelse setup:


Open in new window

0
hi, i have the following json Code:

{"WhoisRecord": { "createdDate": "1997-09-15T00:00:00-0700", "updatedDate": "2015-06-12T10:38:52-0700", "expiresDate": "2020-09-13T21:00:00-0700", "registrant": { "name": "Dns Admin", "organization": "Google Inc.", "street1": "Please contact contact-admin@google.com, 1600 Amphitheatre Parkway", "city": "Mountain View", "state": "CA", "postalCode": "94043", "country": "UNITED STATES", "email": "dns-admin@google.com", "telephone": "16502530000", "fax": "16506188571", "rawText": "Registrant Name: Dns Admin\u000aRegistrant Organization: Google Inc.\u000aRegistrant Street: Please contact contact-admin@google.com, 1600 Amphitheatre Parkway\u000aRegistrant City: Mountain View\u000aRegistrant State/Province: CA\u000aRegistrant Postal Code: 94043\u000aRegistrant Country: US\u000aRegistrant Phone: +1.6502530000\u000aRegistrant Fax: +1.6506188571\u000aRegistrant Email: dns-admin@google.com" }, "administrativeContact": { "name": "DNS Admin", "organization": "Google Inc.", "street1": "1600 Amphitheatre Parkway", "city": "Mountain View", "state": "CA", "postalCode": "94043", "country": "UNITED STATES", "email": "dns-admin@google.com", "telephone": "16506234000", "fax": "16506188571", "rawText": "Admin Name: DNS Admin\u000aAdmin Organization: Google Inc.\u000aAdmin Street: 1600 Amphitheatre Parkway\u000aAdmin City: Mountain View\u000aAdmin State/Province: CA\u000aAdmin Postal Code: 94043\u000aAdmin Country: US\u000aAdmin Phone: 

Open in new window

0
Bootstrap validator trying to validate the form and submit to the database. The validation part works but it does not submit

the link is here https://jsfiddle.net/tsomik1/5cu96c6y/10/
0
I've been using  sys-con.com's code in my Application.cfc file to check for malicious input through FORM and URL variables, but I'm running into issues with hyphenated variable names (specifically Google's reCAPTCHA.) This is the code I use:

<cfloop collection="#form#" item="formelement">
    <cfif isSimpleValue(evaluate(formelement)) AND refindnocase(sqlregex, "#evaluate(formelement)#")>
        <cflocation url="messages.cfm?message=invalid">
        <cfset StructClear(form)>
	<cfabort>
    </cfif>
</cfloop>

Open in new window


And this is the error I'm receiving:

Variable G is undefined.

Which makes sense, because it's looking at g-recaptcha-response. What do I need to do to my code to allow it to accept hyphenated variable names?

Thanks!
0
I am trying to validate using remote options, but it is always validate as failed
<div class="row">
										<div class="col-sm-12 col-xs-12">
											<input type="text" name="userName" placeholder="Username" class="form-control input-lg" required="required" data-bv-remote="true"/>
										</div>
									</div>

Open in new window

 userName: {
                message: 'The username is not valid',
                validators: {
                    notEmpty: {
                        message: 'The username is required and can\'t be empty'
                    },
                    stringLength: {
                        min: 6,
                        max: 30,
                        message: 'The username must be more than 6 and less than 30 characters long'
                    },
                    regexp: {
                        regexp: /^[a-zA-Z0-9_\.]+$/,
                        message: 'The username can only consist of alphabetical, number, dot and underscore'
                    },

                    remote: {
	                    url: '/includes/website.cfc?method=checkusername',
	                    message: {
	                        en_US:  "This usenrame is already taken, please choose another one",
	                    },
	                    data: {
	                        type: 'userName'
	                    },
	                    type: 'POST',
	                    delay: 1000
	                }


                }
            },

Open in new window

<cffunction name="checkusername" output="true" returntype="any" access="remote" returnformat="JSON" >
          <cfargument name="username" required="true" type="string" />
          <!--- set the default value to false --->
          <cfset var emails = StructNew() />
          <cfset emails.valid = "false" />


          <!--- code to check email in system --->
          <cfquery name="findemail" datasource="#request.datasource#">
               select username
               from users
               where username = <cfqueryparam  value="#arguments.username#" cfsqltype="cf_sql_varchar" />
          </cfquery>
          <cfif findemail.RecordCount eq 0>
               <cfset emails.valid = "true" />
          </cfif>
          <cfoutput>#SerializeJSON(emails)#</cfoutput>
     </cffunction>

Open in new window

0
I am looking for a solution that uses CFSCRIPT to remove all text that is surrounded by '<style' and '/style>' including removing the style tags. Can someone show me how I can use something like ReReplaceNoCase to solve this.

For example: if I have text that looks like:

section a <style>here is style to remove</style>section b <style>more style to remove</style>section c

I need the function to return:
section a section b section c

Thank you.
0
Free Tool: Site Down Detector
LVL 8
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

I have an invoice form that needs a date field to be formatted with mm/dd/yy . Its currently working on the client side fine but on the server side I have issues with javascript turned off which is the whole reason I'm formatting it this way. The security requirement is for server  side to catch issues if someone is trying to hack the form w/ javascript turned off in firefox.

Here's the code I have for the parameters:
<cfparam name="form.Invoice_Date" default="">

<cfif session.invoiceDataContr.fileError NEQ 2>
<cfset session.invoiceDataContr.Invoice_Date = "#form.Invoice_Date#">
<cfparam name="form.Invoice_Date" default="">

<cfelse>
<cfset session.invoiceDataContr.Invoice_Date = "#session.invoiceDataContr.Invoice_Date#">

Open in new window


form field:
	<cfset myDate = "#form.Invoice_Date#">
<cfset myYear = #DatePart("yyyy", todayDate)#>
	<cfif isValid("usdate", form.Invoice_Date)>
	     <cfset r_myDate = "20#right(form.Invoice_Date, len(form.Invoice_Date)- 6)#">	
		 <cfif r_myDate GT myYear> 
			<cfset #session.invoiceDataContr.errorString# =#session.invoiceDataContr.errorString#&" No future dates are allowed. Enter date in MM/DD/YY format.,">
	     <cfelse>			  
			<cfif datecompare(todayDate, myDate, "d") EQ -1> 
				<cfset #session.invoiceDataContr.errorString# =#session.invoiceDataContr.errorString#&" No future dates are allowed. Enter date in MM/DD/YY format.,">
			</cfif>			 
		</cfif>       
	<cfelse>
		<cfset #session.invoiceDataContr.errorString# =#session.invoiceDataContr.errorString#&" The Invoice Date is required. No future dates are allowed. Enter date in MM/DD/YY format.,">
	</cfif>	

Open in new window


hidden field:
<input type="hidden" name="Invoice_Date" id="Invoice_Date" value="#HTMLEditFormat(session.invoiceDataContr.Invoice_Date)#">

Open in new window


Its giving me an internal server error when I put the date in as: 4/2/17.

The cf application error log is returning:

The 2 parameter of the Right function, which is now 0, must be a positive integer The specific sequence of files included or processed is: D:\inetpub\wwwroot\**********\**********_verify.cfm, line: 127

It's working for most everything else but this isn't being caught. Before its suggested to use mm/dd/yyyy I can't do that. Specific requirement which is really screwing things up or this wouldn't be an issue likely.

Thanks for any suggestions.
0
Can I use ReReplaceNoCase or someother javascript function to  remove everything in a string from and including '<style' to '/style>'? What would the function call look like?
0
I have created a bootstrap popup login page . When the client click on the login button it will launch the popup and the client will be asked to either login or register. Once login button is clicked I need to validate the credentials and log them in. If the login is not successful I Need to keep them on the same page and show the error message.

Also   I have 2 options forgot user name and forgot password I need to incorporate that within the same popup so it slides and another form is shown
<li class="login-link"><a href="#" data-toggle="modal" data-target="#myModal">Login</a></li>

<div id="myModal" class="modal fade" role="dialog">
			<div class="modal-dialog">
			    <!-- Modal content-->
			    <div class="modal-content">
			    	<div class="modal-header">
			        	<button type="button" class="close" data-dismiss="modal">&times;</button>
						<h2 class="modal-title">Account Login</h2>
			    	</div>
					<div class="modal-body">
						 <form data-toggle="validator" role="form">
			        	<h3>Welcome to I Drive Smart. Please log-in to access your account.</h3>
			        	<div class="form-group">
			        		<input class="modal-username" type="text" name="firstname" class="form-control" data-error="Please enter name field." placeholder="Username" required="required">
			        			<div class="help-block with-errors"></div>
			        	</div>
			        	<div class="form-group">
			        		<input class="modal-password" type="password" 

Open in new window

0
The following code fails and shows the error output in the title. What the heck is going on? Thanks for considering this.

               <form method="post" enctype="multipart/form-data">
                        Select a file:
                        <input type="file" name="fileUpload">
                        <input type="submit" value="Upload File">
                  </form>  
                 
                  <cffile action="upload"
                  accept = "application/pdf,application/msword"
                  filefield="fileUpload"
                  destination="e:\wwwroot\cmis\cmisfiles\security\upload\"  
                  result="FileUploadedYes">

                          <cfdump var="#FileUploadedYes#">
0
I waste lots of time trying to figure out why an insert or update query in ColdFusion is not working.

I typically write code that loads a database table from some other database table.  

It works fine for the first few records, but then I get an error.

I'm loading maybe 15 to 20 columns of data for each record.

What I have been doing is eliminating one column at a time, until I find the piece of data that was not fitting.

Is there a faster way to do this?  

Should I put the query into SQL Server Mgt Studio?  But then I have to copy and paste each bit of data I want to store?

I just can't afford to be this inefficient.  

Hope you can help
0
I have a coldfusion query and I need to search the query by the address with the proximity of 5 miles. The client type their home address and I need to show desired location in the radius of 5 miles
0
I have a coldfusion application running with msql Server 5.7 and windows 7.  While the application works correctly, I am unable to backup the database office_18.sql. The error message is shown below.

I have the same application working on two other pcs which run Windows 10. The backup work in these instances

Is there a known window7  problem in this area and if so, a workaround ?

thanks for any help

james

Environment
windows 7
Coldfusion
Mysql Server 5.7
Application works


CODE
<cftry>  
   <!--- Increase timeout to account for db size. Larger db's require more time for backup --->
   <cfexecute name='C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqldump.exe'
      arguments=" -uroot -pBuddyholly_69 office_18"
      errorVariable="errorMessage"
      outputFile="C:\mysql_backups\office_18.sql"
      timeout="120" />  
	
      <!---errorMessage = <cfoutput>#errorMessage#</cfoutput><br>--->
      <cfdump var="#GetFileInfo('C:\mysql_backups\office_18.sql')#">
      <strong>Votre sauvegarde 1 a reussi</strong> C:\mysql_backups 
	
<cfcatch type="any">  
         <span class="style1"><strong>Votre sauvegarde 1 a echoue</strong></span> C:\mysql_backups  
<cfdump var="#cfcatch#">  
      </cfcatch> 
</cftry> 

Open in new window




error message
Cannot run program "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqldump.exe": CreateProcess error=2, Le fichier spécifié est introuvable
0
Hello, I have some ColdFusion code that runs when the user presses a button. I am using: <cfif structKeyExists(form, "btnRuleCode")> .....code here....</cfif>

My problem is, I need to add a confirmation that pops up when they click the button, so that the user will see a confirmation that pops up before allowing this code to run, or cancel it. I know how to do this with javascript, but I don't know how to stop it from creating that stuctKey when they press the button. Does this make sense? Can anyone assist?

Thank you.
0
I have a form w/ several fields...one of the fields requirements states: The Contract Number is required and can contain no more than 22 alphanumeric characters. This can't contain spaces however:

here's the current regex setup:

	, Contract_Number: {
				required: true
			   ,pattern: /^[DdFfGgHhNnVv][A-Za-z0-9]*$/

Open in new window


Does anyone have any suggestions on how to modify this?
0
Forrester Webinar: xMatters Delivers 261% ROI
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Hi all,

First off thanks for taking the time to look at my concern. Second, I'm a relative newbie to CF, so if it seems like I'm asking the wrong questions, I probably am...

If I cfset application.PropertyName = Property, and then cfdump the application scope, that property appears as expected with the correct value. For example:
<cfif isDefined(form.campaign) AND len(form.campaign) >
        <cfset application.campaign = form.campaign />
    <cfelse>
        <cfset application.campaign = 'default' />
</cfif>
<cfif isDefined(form.channel) AND len(form.channel)>
        <cfset application.channel = form.channel />
    <cfelse>
        <cfset application.channel = form.channel/>
</cfif>
<cfdump var="#application#" />
<cfabort />

Open in new window


renders the form.campaign and form.channel properties properly as application properties.

However, if I cflocation="/path"  to another view after doing so, and cfdump="#application#" again, those properties are no longer available.

This *seems* to be a weirdness regarding Mura, but I'd happily be corrected.

While trying to find out anything I can about this, I stumbled upon the Mura docs for their own scope object, the Mura scope. Is this intended to take the place of Application scope within the context of their framework?

Many thanks.
0
i have been searching on roads for best oracle fusion financials training institute. but i am not able to find the institute which opt for my requirement. where i can find best institutes details with complete details
0
what is wrong with this ?
<CFQUERY datasource="#Application.dsn#" name="addProduct">
                INSERT INTO productsHistory
                (
                  code,commercialname,web,category,description,topnote,middlenote,bottomnote,flashpoint,DEP,vanillin,strength,
                  weightOne,weightTwo,weightThree,weightFour,weightFive,SkinSafe,Soy,SoyRate,Parafin,
                  ParafinRate,Melt,MeltPourRate,Gel,GelRate,ColdPress,ColdPressRate,WaterSoluable,vanillin_status,releaseDate
                 )
                 VALUES
                 ( <cfqueryparam value="#code#" cfsqltype="cf_sql_varchar" maxlength="25">,
                    <cfqueryparam value="#commercialname#" cfsqltype="cf_sql_varchar" maxlength="255">,
                    <cfqueryparam value="#web#" cfsqltype="cf_sql_varchar" maxlength="5">,
                    <cfqueryparam value="#category1#" cfsqltype="cf_sql_varchar" maxlength="100">,
                    <cfqueryparam value="#description#" cfsqltype="cf_sql_longvarchar">,
                    <cfqueryparam value="#topnote#" cfsqltype="cf_sql_varchar" maxlength="50">,
                    <cfqueryparam value="#middlenote#" cfsqltype="cf_sql_varchar" maxlength="50">,
                    <cfqueryparam value="#bottomnote#" cfsqltype="cf_sql_varchar" maxlength="50">,
                    <cfqueryparam value="#fp#" cfsqltype="cf_sql_varchar" maxlength="25">,
                    <cfqueryparam value="#dep#" cfsqltype="cf_sql_varchar"
0
We installed Coldfusion2016 on Windows Server 2012

On the server, the ColdFusion Administrator works flawlessly. The ColdFusion programs can be accessed without a problem when accessed on the server itself e.g. http://myServer:8500/CDM/customer/ /cfProgram1.cfm

However, when we access the ColdFusion programs from a PC on the network, we get error message.
HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

We read on the internet it has something to do with IIS. However, we are not that familiar with IIS.

Any help is greatly appreciated
0
Hi,

I need your help please,

This is what I currently have 
<cfset SpreadsheetAddRow(sObj,"GROUP PRPR ID,GROUP NAME")>

Open in new window


but

This is what I want 
<cfset SpreadsheetAddRow(sObj,"GROUP PRPR ID" & <cfif isdefined('form.GroupName')> ",GROUP NAME" </cfif>")>

I want to be able to say if the Group Name is available then display it. 

Open in new window



Thank you for your help
Lulu
0
Here's the code I'm using:

				jQuery.validator.addMethod(
		"money",
			function(value, element) {
				var isValidMoney = /^(\d+|\d{1,3}(,\d{3})*)(\.\d{2})?$/.test(value);
				if(isValidMoney) {
					var testValue = value;
					testValue = testValue.replace(",","",-1);
					if(testValue <= 0){
						isValidMoney = false;
					}
				}
				return this.optional(element) || isValidMoney;
			},
			"Insert"
		);

Open in new window


			}
			, Invoice_Amount: {
				  required: true
				, money: true
				, pattern: /^\d+\.\d{0,2}$/
				, min: .01
			}

Open in new window


Won't catch where I need it to. Anyone see where this would be failing?
0

ColdFusion Language

9K

Solutions

13

Articles & Videos

3K

Contributors

ColdFusion is a server-side rapid application development platform originally created by Allaire and now sold by Adobe, implementing the dynamic general purpose CFML programming language. The term ColdFusion is sometimes colloquially used to refer to the CFML language (Cold Fusion Markup Language), but can also include discussions of the server software implementation. ColdFusion runs using a customised version of Apache Tomcat. Earlier versions are bundled with JRun.