Home >Backend Development >PHP Tutorial >PHP+Ajax website SEO query tool provides code page 1/3_PHP tutorial

PHP+Ajax website SEO query tool provides code page 1/3_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:55:33784browse

# Name: PHP+Ajax website SEO query tool
# Author: Nianhua [Q:4908220]
# Homepage: http://master8.net
Instructions for use :
1. The server must support at least one of allow_url_fopen, curl, and fsockopen. Please consult the server administrator for details.
2. Please respect the work of others! You can modify and use this program at will, but you are not allowed to modify it and publish it publicly! The integrity of this compressed package should also be maintained when distributing this program!
3. If it is in use If you encounter any problems, please visit http://master8.net/bbs/ to raise them for resolution.
ajax.js

Copy code The code is as follows:

// Name: PHP+ Ajax website SEO query tool
// Author: Nianhua [Q:4908220]
// Notice: Use It After READ readme.txt
// (c) 2007 www.master8.net
var xmlHttp;
function makeRequest(queryString) {
var msXml = new Array();
msXml[0] = "Microsoft.XMLHTTP";
msXml [1] = "MSXML2.XMLHTTP.5.0";
msXml[2] = "MSXML2.XMLHTTP.4.0";
msXml[3] = "MSXML2.XMLHTTP.3.0";
msXml[4 ] = "MSXML2.XMLHTTP";
if (window.xmlHttpRequest) {
xmlHttp = new XMLHttpRequest();
} else {
for (var i = 0; i < msXml.length ; i++) {
try {
xmlHttp = new ActiveXObject(msXml[i]);
break;
} catch (e ) {
xmlHttp = new xmlHttpRequest();
}
                                                                                                                                                  , 'application/x-www-form-urlencoded');
xmlHttp.send(queryString);
}
function getRequest() {
if(xmlHttp.readyState==4) {
if(xmlHttp.status==200) {
$('seo_result').innerHTML = xmlHttp.responseText;
} }
}



seo.php


Copy code
The code is as follows:

# Name: PHP+Ajax 网站SEO查询工具
# Author: 年华 [Q:4908220]
# Notice: Use It After READ readme.txt
# (c) 2007 www.master8.net
define('IN_SEO', TRUE);
error_reporting(E_ERROR);
set_time_limit(0);
isset($_SERVER['HTTP_REFERER']) or exit('Invalid Request');
preg_match("/".$_SERVER['HTTP_HOST']."/i", $_SERVER['HTTP_REFERER']) or exit('Access Denied');
header("Content-Type:text/html;charset=gb2312");
include './robot.php';
require './function.php';
@extract($_POST);
isset($job) && isset($domain) or exit('Invalid Request');
$domain = strtolower($domain);
is_domain($domain) or exit('Invalid Domain');
$jobs=array('google','baidu','yahoo','msn','sogou','iask','so163','zhongsou','vnet');
$result = '';
if(in_array($job, $jobs))
{
    $result = get_seo_info($domain, $job);
}
elseif($job == 'alexa')
{
    $result = Alexa($domain);
}
elseif($job == 'chinarank')
{
    $result = ChinaRank($domain);    
}
elseif($job == 'pagerank')
{
    $result = ' '.$domain;
    if(substr($domain, 0, 4) == 'www.')
    {
        $domain = substr($domain, 4);
        $result.= '   '.$domain;
    }
}
elseif($job == 'sogourank')
{
    $result = sogouRank($domain).' '.$domain;
    if(substr($domain, 0, 4) == 'www.')
    {
        $domain = str_replace("www.", '', $domain);
        $result = $result.'  '.sogouRank($domain).' '.$domain;
    }
}
!empty($result) or exit('Invalid Request');
echo ' '.$result;
?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/318248.htmlTechArticle#Name:PHP+Ajax网站SEO查询工具 #Author:年华nianhua.liu@gmail.com[Q:4908220] #Homepage:http://master8.net 使用说明: 1.服务器必须至少支持allow_url_fopen,curl,fsock...
Statement:
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