netdepviet Đăng vào 3-12-2014 17:26:53

PHP script to check Alexa Ranking

How easy to create a simple php script to check a website Alexa Ranking.

<form name="DomainForm" method="get" action="">
<br>
<table width="490" border="0" bordercolor="#330099" align=center>
<tr>
    <td width="584" height="30" colspan="2" bgcolor="#0099CC"><div align="center"><strong>Domain Name</strong>:
          <input type="text" value="google.com" name="domain" maxlength="63" size="30"> <input type="submit" value="Lookup">
    </div></td>
    </tr>
    <tr>
    <td>(*)<i>To check Google Indexed, Backlinks, PageRanks, Alexa..etc</i><br>
    Whois Domain Checker ( <a href="whois.php" title="Domain Whois Tool"><b>click HERE</b></a> )</td>
    </tr>
</table>
</form>
<?php
$domain=$_GET["domain"]; //your domain name
//start alexa rank
$xml = simplexml_load_file('http://data.alexa.com/data?cli=10&dat=snbamz&url='.$domain);
$alexarank=isset($xml->SD->POPULARITY)?$xml->SD->POPULARITY->attributes()->TEXT:0;
$alexaweb=(string)$xml->SD->attributes()->HOST;
//end alexa rank
echo "$domain &nbsp;has Alexa Rank ".$alexarank;
?>

Save these source code as alexa.php
You can visit at : http://netdepviet.org/seo-tools/?domain=netdepviet.org



Trang: [1]
Xem phiên bản đầy đủ: PHP script to check Alexa Ranking