Skip to main content
Known Participant
March 16, 2011
Answered

URL varible into loop list

  • March 16, 2011
  • 1 reply
  • 379 views

I have a looped query that needs to receive a value from a url string, but I don't know how to reference the string variable in the loop. I get an error with my method.

?p1=open

?p2=open

?p3=open

etc. etc.

I loop through my query <cfloop from="1" to="#menu.RecordCount#" index="i">

but, I want place the url variable into the loop as well

<ul rel="#URL.p#">  <!--- this gives me an error.---> I can do this <ul rel="#URL.p1#"> and it works, but i need it to function based on the p1, p2, p3 etc.

How would I reference this variable in a loop?


    This topic has been closed for replies.
    Correct answer -__cfSearching__-

    #URL.p#

    Almost. If your url variables are named p1, p2, etcetera, the syntax is:

    #URL["p#i#"]# ... OR

    #URL["p"& i]#

    1 reply

    -__cfSearching__-Correct answer
    Inspiring
    March 17, 2011

    #URL.p#

    Almost. If your url variables are named p1, p2, etcetera, the syntax is:

    #URL["p#i#"]# ... OR

    #URL["p"& i]#

    bknutzAuthor
    Known Participant
    March 17, 2011

    Thank you for the reply. I did use: #URL["p"& i]# and it works perfect.