# Name: PHP+Ajax website SEO query tool
# Author: Nianhua
# Homepage: http://master8.net
Instructions for use:
1. Server required At least one of allow_url_fopen, curl, and fsockopen is supported. 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 publish it publicly after modification! The integrity of this compressed package should also be maintained when distributing this program!
3. If you encounter any problems during use , please visit http://master8.net/bbs/ to raise it for resolution.
ajax.js
Copy the code The code is as follows:
// Name: PHP+Ajax Website SEO Query Tool
// Author: Nianhua
// 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.xmlhtp.3.0";
msxml [4] = "MSXML2.XMLHTTP";
if (window.xmlHttpRequest) {
xmlHttp = new XMLHttpRequest();
} else {
for (var i = 0; i < ; msXml.length; i++) {
{
= new xmlHttpRequest();
post', 'seo.php', true);
xmlHttp.setRequestHeader('Content-Type', '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 the code
# Name: PHP+Ajax 网站SEO查询工具
# Author: 年华
# 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;
?>
当前1/3页 123下一页
以上就介绍了seo综合查询 PHP+Ajax 网站SEO查询工具 提供代码第1/3页,包括了seo综合查询方面的内容,希望对PHP教程有兴趣的朋友有所帮助。