Highlighted

How to set a variable to a string with special characters?

New Here ,
Sep 11, 2014

Copy link to clipboard

Copied

I want to set a variable to

<cfset inputstring = "<img src="../../../server/win/form/stamp/string_1" />"/>

but i keep getting error:

Invalid CFML construct found on line 184 at column 32.

ColdFusion was looking at the following text:

.

I have try it different ways , what i'm i doing wrong?

Most Valuable Participant
Correct answer by Carl_Von_Stetten | Most Valuable Participant

You have to either escape the inner quotes or mix single and double quotes.  Try:

<cfset inputstring = "<img src=""../../../server/win/form/stamp/string_1"" />"/>


or

<cfset inputstring = '<img src="../../../server/win/form/stamp/string_1" />'/>


Oh, and the trailing forward slashes aren't necessary in the <cfset> tag.

-Carl V.

Views

129

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How to set a variable to a string with special characters?

New Here ,
Sep 11, 2014

Copy link to clipboard

Copied

I want to set a variable to

<cfset inputstring = "<img src="../../../server/win/form/stamp/string_1" />"/>

but i keep getting error:

Invalid CFML construct found on line 184 at column 32.

ColdFusion was looking at the following text:

.

I have try it different ways , what i'm i doing wrong?

Most Valuable Participant
Correct answer by Carl_Von_Stetten | Most Valuable Participant

You have to either escape the inner quotes or mix single and double quotes.  Try:

<cfset inputstring = "<img src=""../../../server/win/form/stamp/string_1"" />"/>


or

<cfset inputstring = '<img src="../../../server/win/form/stamp/string_1" />'/>


Oh, and the trailing forward slashes aren't necessary in the <cfset> tag.

-Carl V.

Views

130

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 11, 2014 0
Most Valuable Participant ,
Sep 11, 2014

Copy link to clipboard

Copied

You have to either escape the inner quotes or mix single and double quotes.  Try:

<cfset inputstring = "<img src=""../../../server/win/form/stamp/string_1"" />"/>


or

<cfset inputstring = '<img src="../../../server/win/form/stamp/string_1" />'/>


Oh, and the trailing forward slashes aren't necessary in the <cfset> tag.

-Carl V.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 11, 2014 0