Alexa website rank script using PHP, jQuery, Bootstrap and Ajax

alexa website rank script using php, jquery & ajax

Alexa website rank script using PHP, jQuery, Bootstrap and Ajax:

Alexa is a very popular and trusted site to give the rank for all the websites. It is a successful website ranking product of amazon.

They are having many developer API to display every websites country and world rank. You can make use of this API to display any websites rank in your websites/mobile apps.

alexa website rank script using php, jquery & ajax
demo
download

Today we are sharing here the readymade Alexa website rank script using PHP, jQuery, Bootstrap and Ajax. We made it as responsive to help all type of users by supporting all devices. If you are planning to start alexa website rank site or planning to create a mobile app to display the alexa website rank then this script can help you. Script can be added to your existing websites/apps for website ranks.

Extend the content with the code – demo and download options

Required Scripts:

  • Jquery
  • BootStrap [Use only if you need to make your site as responsive].
  • BlockUI [for loading please wait popup]

How to create a online recharge website ?

How to create a book price comparison website ?

How to save more money while shopping online ?

HTML Source Code:

<div class="container" >
	<div class="row">
		<div class="col-md-10 col-md-offset-1 search-header">
			<div class="form-section searchDiv">
				<div class="row">
					<div class="col-md-10">
						<div class="form-group">
							<label class="sr-only" for="inputSiteNm">URL</label>
							<input type="text" class="form-control" id="inputSiteNm" placeholder="Enter your website name to know your Alexa Rank" >
							</div>
						</div>
						<div class="col-md-2">
							<button type="button" class="btn btn-default btn-primary" onclick="loadAlexaRank();">Search</button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

Ajax:

$.ajax( {
type: "POST",
url: "Alexa.php",
data:{siteNm: searchSiteNm },
beforeSend: function() {
$.blockUI({ css: {
border: 'none',
padding: '15px',
backgroundColor: '#000',
'-webkit-border-radius': '10px',
'-moz-border-radius': '10px',
opacity: .5,
color: '#fff'
} });
},
success:function(htmlResp) {
$('div.loadAlexaRankDiv').html(htmlResp);
$('#demoPostTable').addClass( 'nowrap' ).DataTable( {
responsive: true,searching:false,paging:false,ordering:false
});
$.unblockUI();
}
});

Create your own wordpress blog in 60mins ?

Have website/blog, check the speed with this free 6 tools (Very important for SEO)

Online Super tools to find the theme of any wordpress website.

Alexa Website Rank API:

http://data.alexa.com/data?cli=10&dat=snbamz&url=ngdeveloper.com

Alexa.php Source code:

$siteName = $_POST['siteNm'];
$url='http://data.alexa.com/data?cli=10&dat=snbamz&url='.$siteName.'';
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url); // get the url contents
$data = curl_exec($ch); // execute curl request
curl_close($ch);
$xml = simplexml_load_string($data);

$siteName = $xml->SD[1]->POPULARITY['URL'];
$worldRank = $xml->SD[1]->POPULARITY['TEXT'];
$countryName = $xml->SD[1]->COUNTRY['NAME'];
$countryRank = $xml->SD[1]->COUNTRY['RANK'];

Feel free to provide your feedbacks/comments in the below comments section.

Leave a Reply