PHP Script to Identify and Echo Search Engine Terms

I wanted a PHP script that could identify the keywords someone used when searching for my site on a search engine, and then display those keywords on my webpage. For example, my page would say this:

If you were searching for keyword1 keyword2, you’ve come to the right place.

The code shouldn’t be too difficult, unless you want it to work for all search engines.  Fortunately, a few programmers have written complex PHP scripts to handle many search engines. Check out the discussion, some code, and links to some code here: Pulling Keywords from referrer url

Leave a Reply