code example for PHP to record search engine keywords

Source: Internet
Author: User
This article introduces, using PHP to record search engine keywords a piece of code, as a beginner's reference, or good.

Using PHP to record search engine search keywords, the code is as follows:

     ' word ', ' google.com ' = ' Q ', ' sina.com.cn ' = ' word ', ' so                      Hu.com ' + ' word ', ' msn.com ' + ' Q ', ' bing.com ' = ' Q ',      ' 163.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 to search log $sql = "INSERT into Visit_log (DOMAIN,KEY_WORD,CT)"; }?>

The code is very simple, mainly to give everyone a thought: through the analysis of search engine source, intercept the relevant parameter values in the URL, then analyze the key words, matching the relevant search, and recorded into the search log database.

More articles on the search engine keywords , Please refer to: PHP get search engine inbound keyword function PHP record search engine Routing and Keyword Implementation code PHP search spider crawl Record code PHP searches and displays the keyword example PHP get search engine keywords source (support Baidu, Google and other search engines) function

  • 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.