<?php require_once 'ALastFm.php'; if (isset($_GET['pageNum'])) { $pageNum = $_GET['pageNum']; } else { $pageNum = 1; } $country = $_GET['country']; $api = new ALastFm('6d6c2cd3d2199f0e4e63d9ce7374d70c'); $response = $api->searchTopArtist($country, '5', $pageNum); $artist_array = $response['topartists']['artist']; $pages = $response['topartists']['@attr']['totalPages']; /* call to setup page navigation */ $api->setPage($pages, $pageNum); /* call to display the images */ $api->display($artist_array);
<?php require_once 'ALastFm.php'; $id = $_GET['id']; $api = new ALastFm('6d6c2cd3d2199f0e4e63d9ce7374d70c'); $response = $api->searchTopTrack($id, '', ''); $artist_array = $response['toptracks']['track']; echo "<center><h2>{$id}</h2></center>"; $api->displayTrack($artist_array); ?>