[Top] [All Lists]

Finding string

Subject: Finding string
From: "Hydrowizard"
Date: Thu, 17 Jan 2008 13:59:21 +0000 UTC
Newsgroups: macromedia.coldfusion.getting_started
Hi all,
   What I am trying to do is is the string has the string ?p= or ?q= then do 
something with them and if not then output googlewords. I can?t seem to be able 
to get that to work-no errors however-does the ? char cause problems? TIA 

  <cfparam name="url.sortBy" default="id">

 <cfquery name="qrysales">
 SELECT Referer, visit, id
 FROM clientinfo
 where Referer <> "Outside webpage:unknown"
 order by #url.sortBy# 

 <cfoutput query="qrysales"> 

 <cfset strstartp=ReFindnocase("[?q=]|[?p=]", qrysales.Referer)> 
 <cfset referer_find2 = left(qrysales.Referer,len(qrysales.Referer))> 

 <cfset referer_findq = left(qrysales.Referer,len(qrysales.Referer))> 

 <cfset variables.searchPhrase1 = listlast(referer_findq,"=")>  

 <!---then we get rid of all the searchphrase1 rubbish chars--->
 <cfset googlewords=#replacelist(variables.searchphrase1,"+,/,=,%,http:, 

947,SZIR,wl,[%20],26st",", , , , , , , , ")#>

 <cfset variables.searchPhrase2 = listlast(referer_find2,"?=")>

 <cfif len(googlewords) is 0>
 <a href="keywords.cfm?">#googlewords#</a><br>

<Prev in Thread] Current Thread [Next in Thread>