<?php
/*
if( $_SERVER['HTTP_HOST'] == 'prchaxun.cn' )
{
	header("Location: http://wap.prchaxun.cn/");
	exit();
}
*/
/*
*功能:对URL进行编码
*参数说明:$web_url 网站URL，不包含"http://",例如www.zhanzhangpu.com
*完成时间:2009年4月10日
*/
function HashURL($url)
{$SEED = "Mining PageRank is AGAINST GOOGLE'S TERMS OF SERVICE. Yes, I'm talking to you, scammer.";
    $Result = 0x01020345;
    for ($i=0; $i<strlen($url); $i++) 
    {
        $Result ^= ord($SEED{$i%87}) ^ ord($url{$i});
        $Result = (($Result >> 23) & 0x1FF) | $Result << 9;
    }
    return sprintf("8%x", $Result);
}

/*
*功能:获取pagerank
*参数说明:$domain 网站域名，不包含"http://",例如www.zhanzhangpu.com
*完成时间:2009年4月19日
*/
function pagerank($domain)
{	
	$StartURL = "http://www.google.com/search?client=navclient-auto&features=Rank:&q=info:";

	$GoogleURL = $StartURL.$domain. '&ch='.HashURL($domain);

	$fcontents = file_get_contents("$GoogleURL");

	$pagerank = substr($fcontents,9);
	if (!$pagerank) return "0";else return $pagerank;
}

$chaxun_bool = 0;

if ( isset($_GET['website']) )
{
	$chaxun_bool = 1;

	$website = $_GET['website'];
	$website = str_replace("http://","",$website);

	@ $pr = pagerank("$website");
	@ date_default_timezone_set(PRC);

	$now_date = date("Y年n月j日 G时i分s秒");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>站长工具-Google PageRank值查询-73站长网|admin73.com</title>
<link href="../Styles/toolsite.css" rel="stylesheet" type="text/css" />
<link href="../Styles/topbar.css" rel="stylesheet" type="text/css" />
<script src="../Styles/globals.js?ver=20100621" type="text/javascript"></script>
<meta name="keywords" content="" />
<meta name="description" content="" />

</head>
<body>

<div class="wrap">
<?php include("../head.htm"); ?>
<!--加载头部文件 -->
<div class="main">

<div class="box">
  <div id="b_1">
    <h1><div class="titleft">Google PageRank值查询</div> <div class="titright"></div></h1>
   
	<div class="box1" style="text-align:center;"> 
	<form method="get"  action="index.php">
	
    <span class="info3" >
    请输入你要查询的地址：
		<input name="website" type="text" size="50" onMouseOver="this.focus()" onBlur="if (value ==''){value='http://www.'}" onFocus="this.select()" value="<?php
		if( $chaxun_bool == 0 )
		{
			echo 'www.';
		}
		else
		{
			echo ''.$website.'';
		}
	?>" class="input">
	<input type="submit" value="点击查询" class="but">
					   <br />
   
    </span></form>

    <div id="interface1" class="info1">
      <table class="seo" cellpadding="5" cellspacing="1">
		<tr class="seo_head" align="center">
		  <td colspan="9"><?php
		if( $chaxun_bool == 0 )
		{
			echo '未查询';
		}
		else
		{
			echo '网址&nbsp;'.$website.'的Google PageRank值 (网页级别) ';
		}
	?></td>
		</tr>
		<tr class="seo_item">
		  <td colspan="9"><?php
		if( $chaxun_bool == 0 )
		{
			echo '未查询';
		}
		else
		{
			echo '<p id="pr_info"><b>您查询的页面地址：'.$website.' 的PR为 </b><img src="primg/1/'.$pr.'.gif"/><br /><span>查询时间:'.$now_date.'</span></p>';
		}
	?></td>
		  </tr>
		<tr class="seo_item">
		  <td width="19%"><?php
		if( $chaxun_bool == 0 )
		{
			echo '未查询';
		}
		else
		{
			echo '<a href="'.$website.'" title="73站长网PR值查询"><img src="http://127.0.0.1/tool/Rank/pr.php?'.$website.'" border="0"/></a>';
		}
	?></td>
		<td width="81%" colspan="8">
		<form name="form" method="post" action="">
		
		<?php
		if( $chaxun_bool == 0 )
		{
			echo '<textarea name="SEIPcode1" cols="100" rows="4">未查询</textarea>';
		}
		else
		{
			echo '<textarea name="SEIPcode1" cols="100" rows="4"><a href="'.$website.'" title="73站长网PR值查询">
<img src="http://127.0.0.1/tool/Rank/pr.php?'.$website.'"border="0"/></a></textarea>';
		}
	?>
	</form></td></tr>
		</table>
	

    </div>

    </div>
  
  </div>
</div>


<div style="border: 1px solid #BBD7E6;padding:5px;margin:10px 0px 10px 0px;background-color:#FFFFFF;" align="center">

</div>
<div style="margin:0px 0px 4px 0px;_margin:-10px 0px 4px 0px;" >

</div>
<div class="box">
<div id="b_14">
<h1>工具简介</h1>
<div class="box1">
<span class="info2">

<p>Google PageRank (网页级别) 是 Google 搜索引擎用于评测一个网页“重要性”的一种方法。 
Google 通过 PageRank 来调整结果，使那些更具“重要性”的网页在搜索结果中另网站排名获得提升，从而提高搜索结果的相关性和质量。</p>

</span>
</div>
</div>

<!--<div id="b_15">
<h1>工具导航地图</h1>
<div class="box1">
<ul class="toolist" style=" border-bottom:0px; padding-bottom:-2px !important; padding-bottom:3px;">

</ul>
<div style="clear:both;"></div>
</div>
</div> --></div>
</div>
<?php include("../foot.htm"); ?>
</div>
</html>