# Name: PHP + Ajax website SEO Query Tool
# Author: years <nianhua.liu@gmail.com> [Q: 4908220]
# Homepage: http://master8.net
Instructions for use:
1. The server must support at least one of allow_url_fopen, curl, and fsockopen. For details, contact the server administrator.
2. Respect others' labor achievements! You can modify and use this program at will, but it cannot be publicly published after modification! Spread this program should also maintain the integrity of this compressed package!
3. If you encounter any problems during use, please visit http://master8.net/bbs/to make a final decision.
Ajax. js
The Code is as follows:
// Name: PHP + Ajax website SEO Query Tool // Author: years <nianhua.liu@gmail.com> [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 ();
}
}
}
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;
}
}
}
Seo. php
The Code is as follows:
<? Php
# Name: PHP + Ajax website SEO Query Tool
# Author: years <nianhua.liu@gmail.com>
# 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 ('invalidrequest ');
Echo ''. $ result;
?>