macromedia.coldfusion.getting_started
[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# 
 </cfquery> 


 <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:, 

 
3Fq3,'=es',terms,search,query,qkw,2B,&meta,3Fq,3D,2D,2522,26start,26svnum,600,46
947,SZIR,wl,[%20],26st",", , , , , , , , ")#>


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

 <cfif len(googlewords) is 0>
 #variables.searchphrase2#<br>
 <cfelse>
 <a href="keywords.cfm?id=#qrysales.id#">#googlewords#</a><br>
 #variables.searchphrase2#<br>
 </cfif>
      
 </cfoutput>


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