We help IT Professionals succeed at work.

ColdFusion Language

10K

Solutions

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.

Hi,

I am currently trying to learn how to use overlays and have been using this tutorial to help me.

http://jquerytools.org/demos/overlay/modal-dialog.html

The issue is that, while this tutorial keeps the overlay at a fixed position vertically while scrolling the page, it does not keep it centered horizontally while resizing the width of the page.

Is anyone familiar with this tool? Can it be tweaked to make it remain centered horizontally when a page is resized?

Thanks alot!
0
I am trying to encode a coldfusion string from UTF-8 encoding to shift_jis. I'm sending a URL string via CFHTTP to a 3rd party that requires the data to be encoded in shift_jis. I'm not very familiar with encoding and the 3rd party is telling me that the data is encoded as UTF-8 and not Shift_JIS. Below is my code with an example URL string I'm posting. I need to know how to properly encode this string, do I have to convert each URL variable from UTF-8 to Shift_JIS? Putting charset="shift_jis" in my CFHTTP tag is not working.

<CFSET ORDER_URL = 'http://xyz.com/CGI/getResponse.aspx?user=123&firstname=¿¿&lastname=¿¿&addr1=¿¿¿¿¿¿¿¿¿28&addr2=&addr3=&city=-&state=¿¿¿&postalcode=787-0026&country=Japan'>

<CFHTTP METHOD="POST" URL="#ORDER_URL#" THROWONERROR="YES" charset="shift_jis">

<cfhttpparam type="header" name="Accept-Encoding" value="*" />
<cfhttpparam type="header" name="TE" value="deflate;q=0" />

</CFHTTP>
0
I have a radio button which filters records:

<input type="radio" name="showall" id="showall" value="1" />

How can I change the title data in the first row of the excel sheet if this radio button is selected?

I would like "Project Report" to be the default display and when the "showall" radio button is selected it would change to "All Project Reports".

Excel header code:

<cfset querySummary = "Project Report" >
<cfset SpreadsheetMergeCells(sObj, 1, 1, 1, columnsInQuery)>
<cfset SpreadSheetSetCellValue(sObj, querySummary, 1, 1)>
0
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<title>Select Slideshow Test</title>
<link type="text/css" rel="stylesheet" href="/floatbox/floatbox.css" />
<script type="text/javascript" src="/floatbox/floatbox.js"></script>
<style type="text/css">
<!--
body {
	background-color: #CCCCCC;
}
-->
</style>
</head>
<body>


  <cfdirectory
    directory="C:\newservers\History\slideshow\#ID#\"
    name="ImageDirectory"
    filter="*.jpg"
    sort="datelastmodified DESC">

 <cfoutput query="ImageDirectory"> 
<div align="left" class="floatbox" data-fb-options="doSlideshow:true navType:overlay slideInterval:3  group:Images caption:`Date: #ImageDirectory.datelastmodified#`">
 <a href="/slideshow/#ID#/#ImageDirectory.name#">Slideshow</a>
</div>
 </cfoutput>

</body>
</html>

Open in new window


There was no response to my question from the experts so I deleted it in hopes this time I might get some help, which is urgently needed.

I tried the floatboxjs.com forums and the administrator there seems to have big problems with ego and may not want to admit he has no answers, so, this seems to be our  only hope.

=============

We're using FLOATBOX in a dynamic page. Everything works fine but when the code is placed inside a CFOUTPUT query, the start image or start text is duplicated (seen more than once). It's a loop I can't seem to figure out. It's just a simple slideshow but I can't quite get how to get the entry into the slideshow …
0
It have been a long time since I have used coldfusion, so I am a little rusty.  Not sure what I did wrong here

<cfquery name="insertrecord" datasource="brothers" username="user" password="password">
INSERT INTO [dbo].[Bro]
           ([Lname],
           [Mname],
           [Fname],
           [Grad],
           [HStreet],
           [HCity],
           [HState],
           [HZip],
           [PCell],
           [PHome],
           [PBus],
           [HEmail],
           [BEmail],
           [Web],
           [Residence],
           [Wife],
           [Kids],
           [KidsComments],
           [Careers],
           [CareerAwards],
           [Employee],
           [EmployeeComments],
           [EmployeeAwards],
           [MYears],
           [MBranch],
           [MUnit],
           [MRank],
           [MJob],
           [MStationed],
           [MAwards],
           [MComments],
           [SportsComments],
           [SigmaChiActivities],
           [BGSUActivities],
           [BGSUSports],
           [BGSUDegree],
           [BGSUComments],
           [BGSUAwards],
           [Ev1962],
           [Ev1963],
           [Ev1964],
           [Ev1965],
           [Ev1966],
           [Ev1967],
           [Ev1968],
           [PostBGSU])
     VALUES
           (#form.lname#,
           #form.mname#,
           #form.fname#,
           #form.grad#,
           #form.hstreet#,
           #form.hcity#,
           …
0
I have a MSSQL stored procedure that runs fine in the db, but I'm having trouble when I try and use it in my coldfusion code. All the select statements work individually, but no matter what one I have as the last select statement it won't work. I have moved the select statements around, and which ever one is the last one ColdFusion says that it doesn't exist. In debugging, I can see that the SP is being run. What am I missing?

Below is the SP code and the CFML code. I've also attached the error message and the parameters being passed.

STORED PROCEDURE

USE [healthsmartDev]
GO
/****** Object:  StoredProcedure [dbo].[sp_GetPacingGuide]    Script Date: 10/02/2013 11:23:49 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_GetPacingGuide]

@intArrayHBO nvarchar(500),
@intArraySkill nvarchar(50),
@intArrayHBOCat nvarchar(50) output,
@gradeID int,
@HBOCatToRemove int


AS 

BEGIN
SET NOCOUNT ON;

CREATE TABLE #Temp
(
	LessonID int,
	LessonNumber int,
	LessonLabel varchar(100),
	IsAlwaysRecommended bit,
	LessonCategoryLabel varchar(100),
	HBOID int,
	HBOFullCode varchar(16),
	HBOLabel varchar(250),
	SkillID int,
	SkillCode int,
	SkillLabel varchar(50),
	Notes varchar(500),
	LessonDescription Varchar(1000),
	GradeID int,
	HBoCategoryID int,
	HBOCategoryLabel varchar(100),
	CCStandardID int, /*Added 9/18/13 - KJ */
	CCStandardFullCode varchar(100),/*Added 9/18/13 - KJ */
	MuraContentID char(35));
	

INSERT INTO #Temp 
			(LessonID, 

Open in new window

0
I want a better way than the default popup window that comes up when using window.onunload to redirect a user to another page in my site when they attempt to leave.
0
I have a Windows 2008 R2 server, IIS7, Coldfusion 9.0.2, Java sdk1.0.7_25. I created a 2nd CF instance, created an IIS website, used the web server configuration tool to bind the IIS website to the CF instance. Restarted IIS & CF windows services. It does not work as expected. It does not look like the IIS website is actually bound to the 2nd CF instance. With both the Windows IIS service and the new CF service running, I am able to hit the website and click around it.I then stop the CF service and the website still works. I would expect the website to not work when the CF Windows service was stopped. Any ideas as to what is going on?

Thanks ~Joe~

Here are the steps I did to create everything

CF admin > instance manager > Add New Instance with create Windows service option
create the website in IIS
remove the windows CF service
create a windows service and configure it to use a separate jvm.config file
restart IIS & CF services
use the web server configuration tool to bind the new CF instance to the new IIS website and checked off to configure web server for CF9 applications
0
Hello,

I would like to get suggestions on the design question below.

We have a web based product with out 6 major modules.
Out of these, 2 modules are already developed in Windows server 2003, MS SQL 2008, IIS and Adobe ColdFusion.

The other 4 modules, we have the code developed in C# ASP.NET as part of another project.

1. My question is, is there a way in we can use these 4 modules developed in ASP.NET and use them together with other 2 modules?
2. If so will I be able to call the PHP/Coldfusion pages from ASP.NEt pages and viceversa
3. How will it impact on transferring the data between ASP.NEt forms and PHP forms?

Appreciate any inputs on these....
Thank you.
0
Fairly new to Mura, but have found it to be very powerful! Got the hang of pretty much everything, and just today I was installing some plugins. The third one, the Mura Translator, after installing it, wrecked the whole site and now nothing will display - not the front end or the admin. I went and deleted the folders of plugins... all of them. I also went into the DB and manually deleted the plugin entries, in the content table as well. still nothing. any ideas to what i have done?!
0
Need help figuring out why my PDF print function works only on certain PDF's. I don't see any major differences in my PDF docs, there about the same size, yet if I place a working PDF in a non working PDF folder it works. (Each PDF has it's own folder that ColdFusion connects to)

CF error:


500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.


The following information is meant for the website developer for debugging purposes.  

Error Occurred While Processing Request  
Could not print PDF document.  
Null range specified  
 
The error occurred in D:\www\scripts\DD\sendprint.cfm: line 44
 
42 : 	<CFDIRECTORY ACTION="LIST" DIRECTORY="\\DSS1\Shared_Data\www\dwgs\#myarray[i]#" NAME="dcndir" FILTER="*.pdf">
43 : 	<CFLOOP QUERY="dcndir">
44 :      <cfprint type="pdf" source="\\DSS1\Shared_Data\www\dwgs\#myarray[i]#\#name#" attributeStruct="#aset#"> 
46 : 		<CFSET ptotal=ptotal+1>

Open in new window

0
Hello...

So I bought this template...   html template...    and when I look at everything in IE when it is a .html page.. everything works perfect.. .so I go file as .cfm page and then everything is moved to the left and everything is out of place... so I am not sure how changing it to a coldfusion page does that???  Does anyone know why???  I really need to figure this out.

THis is the link to the test site...

http://www.geomaticscanada.com/testsite/index.cfm
0
I have a online form and I'm displaying the email field from the email table.  This field is not valid anymore.  So here is the current script.  Please see attached images.

<CFQUERY NAME="DisplayEmail" datasource="aar" username="#application.username#" password="#application.password#">
    SELECT *
    FROM email
    WHERE email.user_id = #client.user_id#
    </CFQUERY>

   <tr>
              <td height="21">E-Mail:</td>
              <td height="21"><cfoutput>
              #DisplayEmail.email#
                  <input type="hidden" name="email" value="#DisplayEmail.email#">
                </cfoutput>      

Now I want do a change and I would like to display the 'official_email' from the ENR table.
I've tried and it didn't work.

FYI, the enrollee_id_number is primary key into the ENR table which is identical to the foreign key id_number in users table.

How can I do it.. .

  SELECT official_email
    FROM enr, users
    where enr.enrollee_id_number = select .....
ENR.jpg
users.jpg
emailtable.jpg
0
Trying to launch a new cfm page in a  new browser tab - based on a simple cfif evaluation - such as below. So, http://www.cannes-beaux-arts.com  would launch in a fresh tab from the one with the code below.  Can anyone tell me what code (if any) I can use between the cfif tags below..   Thanks for help

<body>
<cfset NAME = "kane">

<cfif #NAME# IS "kane#>  "http://www.cannes-beaux-arts.com" </cfif>


</body>
0
Error Executing Database Query.
[Macromedia][SQLServer JDBC Driver][SQLServer]Error converting data type varchar to float.

update vendors set vendorname = '#vendorname#'
            , contactfirstname = '#contactfirstname#'
            , contactlastname = '#contactlastname#'
            , contactfirstname2 = '#contactfirstname2#'
            , contactlastname2 = '#contactlastname2#'
            , address = '#address#'
            , city = '#city#'
            , state  = '#state#'
            , zip = '#zip#'
            , phone = '#phone#'
            , tollfree = '#tollfree#'
            , fax = '#fax#'
            , website = '#website#'
            , category = '#category#'
            , products = '#products#'
            , mempricing = '#mempricing#'
            , mempricing2 = '#mempricing2#'
            , mempricing3 = '#mempricing3#'
            , mempricing4 = '#mempricing4#'
            , minShipment = '#minShipment#'
            , freightpolicy1 = '#freightpolicy1#'
            , freightpolicy2 = '#freightpolicy2#'
            , orderplacement = '#orderplacement#'
            , terms = '#terms#'
            , schedule = '#schedule#'
            , memallowance = '#memallowance#'
            , memallowance2 = '#memallowance2#'
            , memallowance3 = '#memallowance3#'
            , misc = '#misc#'
            , pdffile = '#pdffile#'
        where vid = #vid#
0
I have an Access database with ColdFusion to display data over the web.

We are currently creating a separate table for the web, from multiple tables with relationships and updating it daily.

I would like to create an Access query that has all the web data.

Can ColdFusion connect to a query in Access instead of a table?

Can I avoid creating relationships in ColdFusion by creating a query in Access?
0
Hi,

I am hoping someone could enlighten me if what I am hoping to accomplish was possible or provide me a suggestion to my task.

I am trying to update a few rows in a table where the same column has values of 'X', 'Y', and 'Z'.

For example,

UPDATE houses_tbl
SET nShow = 1
WHERE houses_id=3 AND houses_id=5 and houses_id=7;

I have a form with a number of house pictures, and each house picture has a check box. The user checks the boxes of the houses they want displayed, and presses the submit form button. Upon form submission, the query would update the field 'nShow' = 1 for the houses that should be displayed...

Thanks guys!
0
I'm sure this is really easy, probably some change which I don't know about, but here goes...

I have a home-grown CMS system that's worked GREAT for me these past 9 years.  Of course, it's gone through many upgrades over the years, but recently a CFIF statement issue arose.  

Over the years, I've used both FCK Editor and TinyMCE WYSIWYG textareas. With these, as many of you know, they automatically populate the textarea with this:

<p>&nbsp;</p>

Open in new window


If the user doesn't enter anything into the editor box, I don't want this code written to the database, so, I had the following CFIF identify and remove this code:

<cfif form.mytext eq '<p>&nbsp;</p>'><cfset form.mytext = ''></cfif>

Open in new window


Unfortunately, this stopped working (ANNOYING!!!)  I tried 'contains' instead of equal, but obviously that doesn't work if they have this code anywhere in their content.  I tried 'contains', then tried to trim off the first 13 characters...THEN see if there was anything in the field, but thought that was dumb, so I figured I'd post this as there was probably some change I haven't come across yet.

Any idea why this would have stopped working and what I should be using to catch and remove this code?
0
Several ColdFusion frameworks use the technique of placing objects (CFC's in coldfusion) into the Application scope. Specifically within Application.cfc.  I would like to know what is actually happening when this occurs. I understand this is how to create a Singleton Pattern but in the back of my mind I always thought of application variables as constants instead of variables and that they should be used to only to tie information to the whole application. For example a datasource name. The datasource name XYZ will always be the same and can be used across the whole web application.

Can someone explain the reasoning and mechanics of placing objects in the Application scope? I'm using ColdFusion but this could be done in any language.
0
I keep getting errors in dynamic built query - coldfusion9

<cfset EuropeCountryList = 
"Albania,Andorra,Armenia,Austria,Azerbaijan,Belarus,Belgium,Bosnia & Herzegovina,Bulgaria,Croatia,Cyprus,Czech Republic,Denmark,Estonia,Finland,France,Georgia,Germany,Greece,Hungary,Iceland,Ireland,Italy,Kosovo,Latvia,Liechtenstein,Lithuania,Luxembourg,Macedonia,Malta,Moldova,Monaco,Montenegro,The Netherlands,Norway,Poland,Portugal,Romania,Russia,San Marino,Serbia,Slovakia,Slovenia,Spain,Sweden,Switzerland,Turkey,Ukraine,United Kingdom,England,Wales,Northern Ireland,Wales,Scotland,Vatican City"
>

<!--- dynamically build query from form fields --->

<cfif IsDefined("form.country")
			and len(trim(form.country))
			and form.country is "europe">
     		and members.Country IN  "#EuropeCountriesList#" 
            
</cfif>

Open in new window


Throws this error

Error Executing Database Query. [Macromedia][SQLServer JDBC Driver][SQLServer]An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Add a name or single space as the alias name.  <br>The error occurred on line 216.


Thanks for your help
0
Hi,
I do local development at home running my own CF server/SQL Server.  I am a Windows person using Windows 7 Home Premium.

I'd like to get a new PC but all Microsoft offers now is Windows 8 - which to me is a not designed for developers but more for media/tablet users.  Plus I don't have the initiative to learn this new operating system (or debug it).

What does the CF development community do for new Windows PC/laptops?

Thanks in advance,
hefterr
0
I am getting an error when trying to send email through my Coldfusion server - using CF 9.0

The error is as follows:  "Error","scheduler-2","08/28/13","09:28:03",,"Could not connect to SMTP host: MAILSERVER, port: 25"

I have other applications and websites (non coldfusion) that are able to send emails to the same MAILSERVER without any problems at all.

Can you help me out?
0
I am trying to run a function to insert data into a table and then use the scope_identity from that insert to redirct a user to a different page. Could someone take a look at my code and let me know what I maybe doing wrong? Everything works except for the redirect after the record is inserted.

from page1.cfm
<cfajaxproxy cfc="mycfc" jsclassname="jsobj">
Function is trigged on a button push.
	function CreateIt(){
	var Type = '#info.Type#';
	var Style = '#info.Style#';
	var ID = #URL.ID#;
	var cfcAsAjax = new jsobj();
	cfcAsAjax.CreateIt(Type,Style,ID);
	ColdFusion.navigate('page2.cfm?mykey='+ '#CreateIt.TheNumber#');
	}

Open in new window


The CFC code:
<cffunction name="CreateIt" output="false" access="remote">
	<cfargument required="false" type="string" name="Type" />
	<cfargument required="false" type="string" name="Style" />
	<cfargument required="true" type="numeric" name="ID" />
	
	<cfquery name="CreateIt">
			INSERT into table2 (Type, Style)

			(select '#arguments.Type#','#arguments.Style#'
			from table1			
			where RefNumber = #arguments.ID#)
			
			select Scope_identity() as TheNumber
	</cfquery>
	<cfreturn CreateIt>
</cffunction>

Open in new window

0
I need help logging into a RETS - Real Estate Transaction Server using Coldfusion.

http://ptest.mris.com:6103/ptest/login
ID = MRISTEST
PW = PMRISTEST
User-Agent = RETS Test/1.0

I know the above information is correct because its documented on their website.

<cfscript>
userAgent = 'RETS Test/1.0';
retsVersion = 'RETS/1.7';
hostname = 'ptest.mris.com';
port = '6103';
username = 'MRISTEST';
password = 'PMRISTEST';
loginArea = 'GET:/ptest/login';
loginUri = '/ptest/login';
realm = 'MRIS';
nc = '00000001';

A1 = Lcase(Hash(username & ':' & realm & ':' & password,"MD5"));
A2 = Lcase(Hash(loginArea,"MD5"));

cnonce = '';

function initial_Auth()
{
	qop = 'auth';
	nonce = '';
	opaque = '';
	response = '';
	rawDigest = 'Digest username=' & chr(34) & username & chr(34) & ',' &
	'realm=' & chr(34) & realm & chr(34) & ',' &
	'nonce=' & nonce & ',' &
	'uri=' & chr(34) & '/rets/login' & chr(34) & ',' &
	'response=' & Lcase(Hash(A1,"MD5")) & ':' & nonce & ':' & Lcase(Hash(A2,"MD5"));
	
	return rawDigest;
}

function create_Auth()
{
	tempList = Replace(cfhttp.responseHeader["WWW-Authenticate"],"Digest ",'','All');
	headerArr = ListToArray(Trim(tempList));
	auth_Temp = ListToArray(Trim(cfhttp.responseHeader["WWW-Authenticate"]),' ');
	auth_Type = auth_Temp[1];
	
	if (auth_Type eq 'Basic')
	{
		auth = username & ':' & password;
		encodedAuth = 'Authorization: Basic ' & toBase64(auth);
		return encodedAuth;
	}

	if(auth_Type eq 'Digest')
	{
		authStc = structNew();
		
		

Open in new window

0
I will receive from a 3rd Party website a public key (exponent and modulus) and I need to encrypt a string with the given key to send the data encrypted.

The Production environment is ColdFusion 7.

I need to use RSA

I'm having some trouble to do this, I don´t know how to encrypt using the key.
Any suggestions of a reliable 3rd party custom tag or alternative?

Note: The 3rd party site has provided the following documentation but it is for PHP.

PHP

This sample requires the use of phpseclib
Ensure that prior to encoding with the RSA algorithm your string is encoded as Unicode (UTF-16 Little Endian).


01 require_once('Crypt/RSA.php');
02       
03      function EncryptMyQueryString($accountLoginType, $userName, $password) {
04          return RSAEncrypt($accountLoginType . "|" . $userName . "|" . $password);
05      }
06      function RSAEncrypt($dataToEncrypt) {
07          $publicKey = '<RSAKeyValue>
08                            <Modulus>uno9DsYcaZ1yAqY20nIM+YjYjjFsGx0DYm7lBGxbmVLLZTYc9MaI0Br+
09                            8ElcuZVVNRmGeVBlkcHT3JpMDf/fiWSho6o0pRhQZmnG4RZtCWnGjFTV+
10                            QWBYcuTGoQFKOtsrGqG16XwL2hPxqYW/7nzBVgAGe6myG3hMou8P4DSpjk=</Modulus>
11                            <Exponent>AQAB</Exponent>
12                            </RSAKeyValue>';
13             $xml = new DOMDocument();
14             $xml->loadXML($publickey);
15       
16             $modulus = new Math_BigInteger(base64_decode($xml->getElementsByTagName('Modulus')->item(0)->nodeValue), …
0

ColdFusion Language

10K

Solutions

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.

Top Experts In
ColdFusion Language
<
Monthly
>