House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home / Groups / ColdFusion Newbie (CF-Newbie)

Replace a URL variable

Author:
Gabriel
06/30/2009 08:03 PM

Nick, Try #reReplace(cgi.query_string, '&Term=[a-z]', '', 'all')# G Read Hi everybody - having a brain fart today - this should be easy but I can't get my head around it. I want to replace a URL variable with a new one, rather than have it duplicate it. (List it twice) I have a page/cfc that has "Letters" for aplha numericically sorting a list - that I pass through the URL.  I include it in a page like so: <CF_AlphaSort AlphaPage="#CurrentPage#?#CGI.QUERY_STRING#" Filter="Sort Name"> Which streams in links that look like this : <CFPARAM NAME="ATTRIBUTES.AlphaPage" DEFAULT=""> <CFPARAM NAME="ATTRIBUTES.Filter" DEFAULT=""> <CFPARAM NAME="URL.Term" DEFAULT=""> <div id="AlphaList"> #ATTRIBUTES.Filter# Filter: <a href="#ATTRIBUTES.AlphaPage#&Term=a">A</a> <a href="#ATTRIBUTES.AlphaPage#&Term=b">B</a> ...etc </div> The problem here is that the SECOND time someone uses the list (sorts twice) it makes a URL like this: www.WEBSITE.com/WEPPAGE.cfm?&Term=a&Term=b And I only want it to list ONE Term in the URL - rather than ADDING terms. (in that example above - term=b ONLY not "a,b" My guess is that I need to use ReplaceNoCase() - but I am not sure how to "wildcard" the "term value" I need to use the CGI.QUERY_STRING because it is common that I will need the OTHER variables I passed to the page. Thoughts? Thanks, - Nick


Search cf-newbie

February 11, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29