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 |