Php code example for recording search engine keywords

Source: Internet
Author: User
Php code example for recording search engine keywords
This article introduces a piece of code that uses php to record search engine keywords. it is a good reference for beginners.

Use php to record search engine search keywords. the code is as follows:

     'Word', 'google. com '=> 'Q', 'sina .com.cn' => 'word', 'sohu. com '=> 'word', 'MSN. com '=> 'Q', 'Bing. com '=> 'Q', '2017. com '=> 'Q', 'Yahoo. com '=> 'P'); $ keyword = ''; $ sengine = $ p ['host']; foreach ($ arr_sd_key as $ se => $ kwd) {if (strpos ($ p ['host'], $ se )! = False) {$ keyword = $ pa [$ kwd]; $ sengine = $ se; break;} // write the search log $ SQL = "insert into visit_log (domain, key_word, ct) ";}?>

The code is very simple, mainly to give you a thought: by analyzing the search engine source, intercepting the relevant parameter values in the url, then analyzing the keywords and matching the relevant search, and record it in the search log database.

More related recordsSearch engine keywordsFor more information, see: php functions for retrieving search engine inbound keywords php record search engine paths and Keyword implementation code php code for retrieving search spider crawling records php search and display keyword examples php getting search engine keywords source (support for Baidu, Google, and other search engines) functions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.