sglee
asked on
Coldfusion Error due to # in URL
Hi,
I have CFM page that used to work just fine, but recently it is generating an error like this:
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------
Invalid CFML construct found on line 28 at column 189.
ColdFusion was looking at the following text: /"
The CFML compiler was processing:
An expression that began on line 28, column 179.
The expression might be missing an ending #, for example, #expr instead of #expr#.
The body of a CFMAIL tag beginning on line 20, column 10.
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --
Here is the statement that is failing.
<a href="https://www.sourcedomain.com/sports/event/050036DC?artistid=873854&majorcatid=10001&minorcatid=1&tm_link=browse_msg-0_0500535DD86A36DC#efeat4212">
<img border="0" src="http://www.mydomain.info/eimage/#Picture#" align="middle">
</a>
I know it is the # sign that is the causing the problem, but I don't how how to fix this.
Thanks.
I have CFM page that used to work just fine, but recently it is generating an error like this:
--------------------------
Invalid CFML construct found on line 28 at column 189.
ColdFusion was looking at the following text: /"
The CFML compiler was processing:
An expression that began on line 28, column 179.
The expression might be missing an ending #, for example, #expr instead of #expr#.
The body of a CFMAIL tag beginning on line 20, column 10.
--------------------------
Here is the statement that is failing.
<a href="https://www.sourcedomain.com/sports/event/050036DC?artistid=873854&majorcatid=10001&minorcatid=1&tm_link=browse_msg-0_0500535DD86A36DC#efeat4212">
<img border="0" src="http://www.mydomain.info/eimage/#Picture#" align="middle">
</a>
I know it is the # sign that is the causing the problem, but I don't how how to fix this.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Shaun, I think the one that is a problem is this one in the URL: #efeat4212
ASKER
Sorry about the fact that I was not clear which # I thought was causing the error.
It is # in #efeat4212.
The URL provider sends us the URL to insert into our webpage. We just add them to our web page, but this is first time that # was embedded.
It is # in #efeat4212.
The URL provider sends us the URL to insert into our webpage. We just add them to our web page, but this is first time that # was embedded.
In a URL like that, '#' refers to an anchor on the target page. That's why it is not 'legal' for any other use.
You can escape # with a double ## - CF will convert to #
https://www.bennadel.com/blog/1270-be-careful-using-in-coldfusion-de-expressions.htm