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

Posted on 2008-11-10
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

    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

    urlencodedformat will do this for you:


    Author Closing Comment

    Thank you.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    how can I backup my incomplete website from hostgator? 3 45
    Database set up 5 53
    PHP Register global 21 60
    Web Site Hosting 10 57
    PROBLEM:  How to open a cfwindow or run a function on double click of a cfgrid row. One of my clients wanted to be able to double click on a row item to get more detailed information about a transaction and to be able to modify the line items i…
    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 …
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    745 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now