<?php
if(!empty($_REQUEST['show_source'])){
    show_source("pr.php");
    die(0);
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>PR值查询 | PageRank 查询</title>
</head>
<body onload="javascript:document.frmPr.txtUrl.focus();">
<br>
<br>
<form name="frmPr" method="post" action="pr.php">
输入要查询的网址:
<input type="text" name="txtUrl" size="30">
<input type="submit">
</form>
<?php
if(!empty($_REQUEST['txtUrl'])){
    $url=$_REQUEST['txtUrl'];
    $f2= file_get_contents("http://www.getyourpagerank.com/rank.php?url=".$url);
    preg_match("/PageRank:s*(d*)/i",$f2,$pagerank);
    $hrefurl="http://".str_replace("http://","",$url);
    echo "<a href="".$hrefurl."" target="_blank">".$url."</a> 的PR值是:".$pagerank[1]."<br>";
}
?>
</body>
</html>