|
Mailing Lists
|
Home / Groups / ColdFusion Newbie (CF-Newbie)
Replace a URL variableNick, 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 |
February 11, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||