Skip navigation
chuck1rar
Currently Being Moderated

Passing variable into url

Aug 1, 2012 9:22 AM

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&amp;OrderID=' #Str_Order# ' "> test</a></p>

 
Replies
  • Currently Being Moderated
    Aug 1, 2012 1:35 PM   in reply to chuck1rar

    Try This

    ------

    <cfoutput>

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

    </cfoutput>

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 1, 2012 2:40 PM   in reply to chuck1rar

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 1, 2012 3:37 PM   in reply to chuck1rar

    If this is your actual code:

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

     

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

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points