时间:2021-07-01 10:21:17 帮助过:17人阅读
代码如下:
// Name: PHP+Ajax 网站SEO查询工具
// Author: 年华
// 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();
}
}
}
xmlHttp.onreadystatechange = getRequest;
xmlHttp.open('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;
}
}
}
代码如下:
# 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教程有兴趣的朋友有所帮助。