Highlight search queries in the forum when you come from websearch

in the recent past, I noticed quite often that when you search for something using google and search for one of the search results, the search terms are in bold on the site.

How can I do that? is it a google function that messes with other sites (hopefully not!) or do some sites analyze the referrer and check links to search engines and try to talk about search queries?

I'm curious for the answers

+6
search-engine highlight
source share
4 answers

after searching for some time i found a plugin for phpBB .

it can be found on its forums: http://www.phpbb.com/community/viewtopic.php?f=69&t=784615

he will take into account all popular search engines and highlight search queries on the forum. reading a plugin is a great source of information

0
source share

This feature works by looking at the HTTP referral header sent by the browser. This post should explain how it works: http://weblogtoolscollection.com/archives/2009/04/10/how-to-highlight-search-terms-with-jquery/

+4
source share

You should examine the HTTP link of the referrer http server, there you will find the URL where the user comes from.

+2
source share

I believe that you can look in the HTTP headers for the referrer (i.e. the previous URL). If your visitor arrives from Google, this will be the URL of the search page. Submitting this header is a feature of most web browsers, and it is useful for such things. Since Google search results are GET requests, the referrerโ€™s standard URL looks like this:

http://www.google.com/search?q=stack+overflow

You can analyze them to get the request conditions and format accordingly using the server side of the script. I am sure that there is a library there, but writing it will not be difficult.

+2
source share

All Articles