Skip to main content
Participating Frequently
August 1, 2012
Question

Passing variable into url

  • August 1, 2012
  • 3 replies
  • 800 views

Am sure am missing something but why doesnt this work???

If I hardcode the string value it works fine...

<cfset Str_Order =#rsorder.order_id#>

<cfoutput> #Str_Order# </cfoutput>

<p><a href="MyAccount.cfm?view=customsinvoice&OrderID=' #Str_Order# ' "> test</a></p>

    This topic has been closed for replies.

    3 replies

    Inspiring
    August 1, 2012

    If this is your actual code:

    <a href="MyAccount.cfm?view=customsinvoice&OrderID=' #Str_Order# ' ">

    You don't need the single quotes and you don't want the spaces.

    12Robots
    Participating Frequently
    August 1, 2012

    Lose the single quotes.

    Saurav's idea should work as well.

    In either case, you should also encode for url.

    <cfoutput>

    <p><a href="MyAccount.cfm?view=customsinvoice&OrderID=#URLEncodedFormat(Str_Order)#"> test</a></p>

    </cfoutput>

    jason

    glamorous_Wonder6C1C
    Inspiring
    August 1, 2012

    Try This

    ------

    <cfoutput>

    <p><a href="MyAccount.cfm?view=customsinvoice&OrderID=#Str_Order#"> test</a></p>

    </cfoutput>