Skip to main content
lovewebdev
Inspiring
September 9, 2009
Question

Loop through & display Name+Values of URL Parameters in QueryString?

  • September 9, 2009
  • 2 replies
  • 14977 views

I have a page with URL Parameters posted to it.

Is there a way to to loop through the URL parameters and display the name and value of all the URL Parameters?

Thanks!

This topic has been closed for replies.

2 replies

Inspiring
September 9, 2009

Look at cgi.query_string.  Google "coldfusion listfunctions" if you don't know what to do with that variable.

lovewebdev
Inspiring
September 9, 2009

I got this so far:

<cfloop item="key" collection="#URL#">
<cfoutput>#key# - #URL[key]#<br></cfoutput>
</cfloop>

What I need to do is Sort the Names in ascending order ignoring case.

And I also need to remove from this list the name + value of one of the URL Parameters I know exists in the querystring

ilssac
Inspiring
September 9, 2009

One idea off the top of my head.

<cfset keyList = listSort(structKeyList(url),'textnocase','asc')>

<!--- check my syntax on the listSort() function --->

<cfloop list="#keyList#" index="key">

    <cfoutput>#key# - #url[key]#</cfoutput>

</cfloop>

lovewebdev
Inspiring
September 9, 2009

That's perfect.

Now is there a way to remove a particular URL Parameter from the list by name?