Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 25th, 2006, 05:47 PM
minus4's Avatar
minus4 minus4 is offline
short arse brainiac
ASP Free Novice (500 - 999 posts)
 
Join Date: Jun 2005
Location: Leeds UK
Posts: 577 minus4 User rank is Sergeant Major (2000 - 5000 Reputation Level)minus4 User rank is Sergeant Major (2000 - 5000 Reputation Level)minus4 User rank is Sergeant Major (2000 - 5000 Reputation Level)minus4 User rank is Sergeant Major (2000 - 5000 Reputation Level)minus4 User rank is Sergeant Major (2000 - 5000 Reputation Level)minus4 User rank is Sergeant Major (2000 - 5000 Reputation Level)  Folding Points: 800 Folding Title: Novice Folder
Time spent in forums: 4 Days 1 h 39 m 38 sec
Reputation Power: 30
Send a message via MSN to minus4
Collection search string used to find your site

I have just been answering a referer question and i thought hay, maybe someone may find this code i use, helpful.

this code will collect the search string a user used to find your site.
from the main players in search engines.

with this information, you know how people are finding you, and how to inprove that, so that you get to the top.

Code:
<%

 

StrFrom= TRIM(request.servervariables("HTTP_REFERER"))

  StrFrom=lcase(StrFrom)
  
  if instr(StrFrom,"google")<>0 then
  	searchEngine		="Google"   
  	startfrom	=instr(StrFrom,"q=")
  	
  	if startfrom>0 then  	
  	 startfrom=startfrom+2
  	 
  	 ending		=instr(startfrom+1,StrFrom,"&")
  	 
  	 if ending=0 then
  	  searchKeywords		=mid(StrFrom,startfrom)  	  	  
  	 else
  	  searchKeywords		=mid(StrFrom,startfrom,ending-startfrom)  	  	  
  	 end if
  	 
  	end if
  	  	
  end if
  
  if instr(StrFrom,"msn.com")<>0 then
  	searchEngine		="MSN"   
  	startfrom	=instr(StrFrom,"&q=&q=")
  	
  	if startfrom>0 then  	
  	 startfrom=startfrom+6
  	 
  	 ending		=instr(startfrom+1,StrFrom,"&")
  	 
  	 if ending=0 then
  	  searchKeywords		=mid(StrFrom,startfrom)  	  	  
  	 else
  	  searchKeywords		=mid(StrFrom,startfrom,ending-startfrom)  	  	  
  	 end if
  	 
  	end if
  	  	
  end if
  
  if instr(StrFrom,"altavista.com")<>0 then
  	searchEngine		="Altavista"   
  	startfrom	=instr(StrFrom,"q=")
  	
  	if startfrom>0 then  	
  	 startfrom=startfrom+2
  	 
  	 ending		=instr(startfrom+1,StrFrom,"&")
  	 
  	 if ending=0 then
  	  searchKeywords		=mid(StrFrom,startfrom)  	  	  
  	 else
  	  searchKeywords		=mid(StrFrom,startfrom,ending-startfrom)  	  	  
  	 end if
  	 
  	end if
  	  	
  end if
  
  if instr(StrFrom,"aol.co")<>0 then
  	searchEngine		="Aol"   
  	startfrom	=instr(StrFrom,"query=")
  	
  	if startfrom>0 then  	
  	  startfrom=startfrom+6
  	 
  	 ending		=instr(startfrom+1,StrFrom,"&")
  	 
  	 if ending=0 then
  	  searchKeywords		=mid(StrFrom,startfrom)  	  	  
  	 else
  	  searchKeywords		=mid(StrFrom,startfrom,ending-startfrom)  	  	  
  	 end if
  	 
  	end if
  	  	
  end if
  
  if instr(StrFrom,"mama.com")<>0 or instr(StrFrom,"mamma.com")<>0 then
  	searchEngine		="Mama"   
  	startfrom	=instr(StrFrom,"query=")
  	
  	if startfrom>0 then  	
  	 startfrom=startfrom+6
  	   ending		=instr(startfrom+1,StrFrom,"&")
  	 if ending=0 then
  	  searchKeywords		=mid(StrFrom,startfrom)  	  	  
  	 else
  	  searchKeywords		=mid(StrFrom,startfrom,ending-startfrom)  	  	  
  	 end if
  	 
  	end if
  	  
  end if
  
  if instr(StrFrom,"yahoo.co")<>0 then
  	searchEngine		="Yahoo"   
  	startfrom	=instr(StrFrom,"p=")
  	
  	if startfrom>0 then  	
  	 startfrom=startfrom+2
  	 
  	 ending		=instr(startfrom+1,StrFrom,"&")
  	 
  	 if ending=0 then
  	  searchKeywords		=mid(StrFrom,startfrom)  	  	  
  	 else
  	  searchKeywords		=mid(StrFrom,startfrom,ending-startfrom)  	  	  
  	 end if
  	 
  	end if
  	  	
  end if
  
  if instr(StrFrom,"metacrawler.com")<>0 then
  	searchEngine		="MetaCrawler"   
  	startfrom	=instr(StrFrom,"web/")
  	
  	if startfrom>0 then  	
  	 startfrom=startfrom+4
  	 
  	 ending		=instr(startfrom+1,StrFrom,"&")
  	 
  	 if ending=0 then
  	  searchKeywords		=mid(StrFrom,startfrom)  	  	  
  	 else
  	  searchKeywords		=mid(StrFrom,startfrom,ending-startfrom)  	  	  
  	 end if
  	 
  	end if
  	  	
  end if
        
  
  if instr(StrFrom,"ask.com")<>0 then
  	searchEngine		="Ask.com"   
  	startfrom	=instr(StrFrom,"q=")
  	
  	if startfrom>0 then  	
  	 startfrom=startfrom+2
  	 
  	 ending		=instr(startfrom+1,StrFrom,"&")
  	 
  	 if ending=0 then
  	  searchKeywords		=mid(StrFrom,startfrom)  	  	  
  	 else
  	  searchKeywords		=mid(StrFrom,startfrom,ending-startfrom)  	  	  
  	 end if
  	 
  	end if
  	  	
  end if
  
  if instr(StrFrom,"vivisimo.com")<>0 then
  	searchEngine		="Vivisimo.com"   
  	startfrom	=instr(StrFrom,"query=")
  	
  	if startfrom>0 then  	
  	 startfrom=startfrom+6
  	 
  	 ending		=instr(startfrom+1,StrFrom,"&")
  	 
  	 if ending=0 then
  	  searchKeywords		=mid(StrFrom,startfrom)  	  	  
  	 else
  	  searchKeywords		=mid(StrFrom,startfrom,ending-startfrom)  	  	  
  	 end if
  	 
  	end if
  	  	
  end if
   	
end sub
%>

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Collection search string used to find your site


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT