Neal,

How about this:

<CFIF Right(cgi.HTTP_REFERER,1) IS "?">
        <!--- URL ends with ? --->
</CFIF>


If this is true, then the URL ends with a "?".  I don't know whether
having multiple ? in the URL will be necessary.  If so, and if this will
even work (I can't remember whether it causes browser error), then you
should use this instead:

<CFIF Right(cgi.HTTP_REFERER,1) IS "?" AND not
Find(cgi.HTTP_REFERRER,"?",Find(cgi.HTTP_REFERRER,"?") + 1)>
        <!--- URL ends with ? that does not terminate valid query string
--->
</CFIF>


HTH,
Matthieu




-----Original Message-----
From: Bailey, Neal [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 29, 2005 3:44 PM
To: CF-Talk
Subject: Query String Dud - issue


Hey Guys... 
 
It's been a long time since I posted here... 
Well I have an issue and I just can't figure it out I think I have been
staring at it too long now and my Braine is fried. Any help would be
appreciated. Thanks.
 
Ok the issue is... I have the Bit of Code that will strip out most
keywords coming from a referring search engine and then store it in a
database. My problem is when a site links to my site and has an ending
"?" and no query string I get an error. Stay with me, here is an
example. 
 
http://www.26liter.us/news.html <http://www.26liter.us/news.html> ?
 
If you visit that site and click on the link on the page that says
"Texas Motor Sport Ranch" you will get an error on my site. 
 
The error is with this bit of Code. 
<cfset referer_queryString =
right(cgi.http_referer,len(cgi.HTTP_REFERER)-strStart)>
 
 
 
Here is the whole section of code that I am using:
 
<cfif len(cgi.HTTP_REFERER)>
<cfif find("?", cgi.HTTP_REFERER)>
  <cfset paramList =
"q,p,terms,search,query,Keywords,keyword,Keyword,keywords,qkw,as_epq,sea
rchf
or,prev,qry,terms,term,k,s,ATC">
  <cfset strStart = find("?", cgi.HTTP_REFERER)>
  <cfset referer_queryString =
right(cgi.http_referer,len(cgi.HTTP_REFERER)-strStart)>
  <cfset referer_url = left(cgi.HTTP_REFERER,(strStart-1))>
  <cfloop list="#referer_queryString#" delimiters="&" index="i">
   <cfif listfind(paramList,listfirst(i,"="))>
    <cfset variables.searchPhrase = listlast(i,"=")>
    <cfset variables.searchPhrase = ReplaceList(listlast(i,"="),
"+,%22,%2C,%20,%2B,%2F,%3A,%28,%29,%2E,%26", " , , , , ,/,:,(,),.,&")>
   </cfif>
  </cfloop>
</cfif>
</cfif>
 
Is there a way to clean an referring url if it does not have actually
have a query string?
 
I have trying a few things but I either fix it and break something else
or just mess it up more. 
 
Any ideas?
 
Thanks. 
Neal Bailey
 
 
 
 




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227942
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to