Need to escape a hash (#) symbol in Coldfusion url?

Posted on 2008-11-10
Medium Priority
Last Modified: 2013-12-24
I need to replace the (#) with a hex symbol it hasn't worked for me not sure if its correct. I also have a + symbol that Im replacing as well. The query is being pulled from the url.
#Replace(Replace(Replace(COURSE_DESCR,"++","%2B%2B"), "+", "%2B"), "##", "%23")#&ACAD_PLAN=#ACAD_PLAN#"> My Link </a>

Open in new window

Question by:tribalboy3000
LVL 63

Expert Comment

ID: 22926286
Check this:
<a href="frm_Insert.cfm?COURSETITLE=#Trim(COURSETITLE)#&TABLENAME=COURSE_DESCR&FORMVALUE=#Replace(Replace(COURSE_DESCR,"+","%2B","all"),"##","%23","all")#&ACAD_PLAN=#ACAD_PLAN#"> My Link </a>

Open in new window

LVL 10

Accepted Solution

Mause earned 2000 total points
ID: 22929954
urlencodedformat will do this for you:


Author Closing Comment

ID: 31515305
Thank you.

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
There may be issues when you are trying to access Outlook or send & receive emails or due to Outlook crash which leads to corrupt or damaged PST file. To eliminate the corruption from your PST file, you need to repair the corrupt Outlook PST file. U…
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question