[Top] [All Lists]

variables.searchphrasepq undefined

Subject: variables.searchphrasepq undefined
From: "Hydrowizard"
Date: Tue, 15 Jan 2008 15:05:52 +0000 UTC
Newsgroups: macromedia.coldfusion.getting_started

Hi all I`ve been working on this for a while now and it has been useful to 
understand lists and list functions. The following code gets whatever keywords 
there are on the right(listlast really) of the = delimiter. This works fine for 
google but no I tried to add a new condition as other search engines use ?p= or 
?q= to define string so a string like it will get the first in the 
list after the ?p= not N if that makes sense. I thought I was getting there 
defining if the string has <cfset findq=find("[p=]|[q=]", qrysales.referer)> 
 Really I just need a hand please and a push in the right direction-not code 
just a nod as to what I need to do! Thanks    
 <table width="792">
  <div align="center">
       <a href="searchengines.cfm?sortBy=visit">Date</a>
 <td> <div align="center">
       <a href="searchengines.cfm?sortBy=id">Visit No.</a>
 <td> <div align="center">
       <a href="searchengines.cfm?sortBy=id">Search Engine</a>
 <td> <div align="center">
       <a href="searchengines.cfm?sortBy=referer">Keywords (click on record to 
see full query)</a>

 <!---  output the all the rows in the query qrysales --->
 <cfoutput query="qrysales" startrow="#nav.startrow#" maxrows="#nav.maxrows#"> 

 <cfset strStart = find("?", qrysales.Referer)> 

 <cfset referer_queryString = 

 <cfset findq=find("[p=]|[q=]", qrysales.referer)>
 <cfset referer_findq = left(qrysales.Referer,len(qrysales.Referer)-findq)> 
 <cfif find("[p=]|[q=]", referer_findq)>
 <cfset searchPhrasepq = listfirst(referer_findq,"=")>  

 <cfloop list="referer_querystring" delimiters="%" index="i" >

 <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",", , , , , , , , ")#>

 <tr bgcolor="###iif(currentrow MOD 2,DE('ffffff'),DE('efefef'))#">
 <td>  <cfif find("", qrysales.referer)>
       Google Italy
 <cfelseif find("google", qrysales.referer)>
 <cfelseif find("msn", qrysales.referer) or find("", qrysales.referer)>
       MSN Live
 <cfelseif find("yahoo", qrysales.referer)>
 <cfelseif qrysales.referer does not contain "google" or qrysales.referer does 
not contain "yahoo"
  or qrysales.referer does not contain "msn">
       Other search engine
 <cfif len(googlewords) is 0>
 <cfelseif len(googlewords) and find("N", "#googlewords#")>
 <cfset innitnow=find("N", "#googlewords#")>
 #variables.searchphrasepq# n found


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



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