[thelist] ColdFusion & URL Variables
Morgan Kelsey
morgan at morgankelsey.com
Wed Nov 20 10:17:01 CST 2002
> this will put the remove_route= values into a "remove" list for you:
>
> <cfset myurlarray = ListToArray(cgi.query_string,"&")>
> <cfset removelist = "">
> <cfloop index="i" from="1" to="#ArrayLen(myurlarray)#">
> <cfif Lcase(Left(myurlarray[i],13)) is "remove_route=">
> <cfset route = mid(myurlarray[i],14,len(myurlarray[i])-13)>
> <cfset removelist = ListAppend(removelist,route)>
> </cfif>
> </cfloop>
> <cfoutput> #removelist# </cfoutput>
>
hmmm, that will work, rudy is right -- nice work rudimeister.
small enhancement, you can do this:
<cfset route = mid(myurlarray[i],14,len(myurlarray[i])-13)>
a little simpler like this:
<cfset route = ListLast(myurlarray[i],'=')>
and you might wanna copy the list back to the url structure, so you don't go
nuts down the road:
<cfset url.remove_route = removelist>
but darn, nagrom is kicking himself for forgetting the query_string...heh
nagrom
More information about the thelist
mailing list