Home > Backend Development > PHP Tutorial > PHP website anti-link collection query google, baidu anti-link_PHP tutorial

PHP website anti-link collection query google, baidu anti-link_PHP tutorial

WBOY
Release: 2016-07-20 11:06:28
Original
1172 people have browsed it

This article is mainly about a website backlink and inclusion query written for Google and Baidu.

This article is mainly about a website backlink and inclusion query written for Google and Baidu.

if($site) {
$buffer = @file_get_contents('http://www.baidu.com/s?wd=site%3A' . $site, 'r');
if($ buffer) {
$BaiduSite = cut($buffer, 'Find relevant web pages', 'article');
$BaiduSite = str_replace(array('about', ','), '', $BaiduSite) ;
}
$buffer = @file_get_contents('http://www.baidu.com/s?wd=domain%3A' . $site, 'r');
if($buffer) {
$BaiduDomain = cut($buffer, 'Find relevant web pages', 'article');
$BaiduDomain = str_replace(array('about', ','), '', $BaiduDomain);
}
$buffer = @file_get_contents('http://www.google.cn/search?q=site%3A' . $site, 'r');
if($buffer) {
$GoogleSite = cut($buffer, 'with', ' ');
$GoogleSite = str_replace(',', '', $GoogleSite);
}
$buffer = @file_get_contents('http://www.google.cn/search?q=link%3A' . $site, 'r');
if($buffer) {
$ GoogleLink = cut($buffer, 'There are ', ' items');
$GoogleLink = str_replace(',', '', $GoogleLink);
}
}

include MooTemplate("site_index");

function cut($file, $from, $end) {
$message = explode($from, $file);
$message = explode($end, $message[1]);
return $message[0];
}


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445050.htmlTechArticleThis article is mainly for website backlink and inclusion query written for Google and Baidu. It is a website backlink and inclusion query written for Google and Baidu, if($site) { $buff...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template