?
Solved

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

Posted on 2008-11-10
3
Medium Priority
?
2,056 Views
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.
<a href="frm_Insert.cfm?COURSETITLE=#Trim(COURSETITLE)#&TABLENAME=COURSE_DESCR&FORMVALUE=
#Replace(Replace(Replace(COURSE_DESCR,"++","%2B%2B"), "+", "%2B"), "##", "%23")#&ACAD_PLAN=#ACAD_PLAN#"> My Link </a>

Open in new window

0
Comment
Question by:tribalboy3000
3 Comments
 
LVL 63

Expert Comment

by:Zvonko
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

0
 
LVL 10

Accepted Solution

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

<a href="frm_Insert.cfm?COURSETITLE=#Trim(COURSETITLE)#&TABLENAME=COURSE_DESCR&FORMVALUE=#urlencodedformat(COURSE_DESCR)#&ACAD_PLAN=#ACAD_PLAN#"> My Link </a>
0
 

Author Closing Comment

by:tribalboy3000
ID: 31515305
Thank you.
0

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