Nét Đẹp Việt Nam

Tiêu đề: PHP script to check Alexa Ranking [In trang]

Tác giả: netdepviet    Thời gian: 3-12-2014 05:26 PM
Tiêu đề: PHP script to check Alexa Ranking
How easy to create a simple php script to check a website Alexa Ranking.

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

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








Chào mừng ghé thăm Nét Đẹp Việt Nam (https://missvietnam.org/forum/) Powered by Discuz! X3.2