|
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[1]->POPULARITY)?$xml->SD[1]->POPULARITY->attributes()->TEXT:0;
- $alexaweb=(string)$xml->SD[0]->attributes()->HOST;
- //end alexa rank
- echo "$domain has Alexa Rank ".$alexarank;
- ?>
Sao chép mã
Save these source code as alexa.php
You can visit at : http://netdepviet.org/seo-tools/?domain=netdepviet.org
|
|