Specifically it's dropping the ampersand "&" and all characters after this.
I have a simple search form that sends the search item to an action page where depending on what variables are sent it either processes the form or sends the variable in the url to another page to get processed.
The form sends the variables correctly to the processing page. Using cfdump I see I'm getting the correct search item. Then I use cflocation to send the search item to a different page for processing but at this point on the third page the variable is missing anything behind the ampersand. "A&B" becomes "A"
My processing page looks like this.
<cfif IsDefined("form.how") and #form.how# eq "any">
<cfset theitem = #trim(form.item)#>
<cflocation url="search.cfm?item=#theitem#" addtoken="no">
I receive "A&B" on this processing page but on the search.cfm page when dumping out the url variable I receive "A" and everything beyond and including the & is stripped.
I've tried setting the item variable as a session variable on the processing page but that didn't work either. I've tried using a meta refresh tag but got the same results. I've googled and do not see anything on this.
The "&" sign should be a valid character to search for in the database.
Any suggestions? thanks
Well... & has special meaning in a URL, doesn't it? it's the separator between parameter name/value pairs. So if you need it to be in your data (ie: the value of a parameter) you need to encode it so the web server KNOWS it's data and not part of the URL structure.
On CF10 use encodeForUrl():
On previous versions use urlEncodedFormat():
Europe, Middle East and Africa