...

View Full Version : Amazon CD Cover php



TobyCS
05-08-2009, 06:25 PM
I am using a php album cover for my radio site. I have the vairable $song[0] to $song[10], how can i make it so $image[0] = $song[0], $image[1] = $song[1], etc.

Thanks


<title>Album</title>
<style type="text/css">
body {
margin:0px; padding:0px;
background:url('noalbum.jpg');
}
</style>
<?php
include('stats.php');

error_reporting(0);

$songtitle = substr($song[0], 0, "47");

$new = explode('-', $song[0]);

require_once 'Zend/Service/Amazon.php';

$amazon = new Zend_Service_Amazon('1786NSJ6HRKFHCY582R2','UK');

$results = $amazon->itemSearch(array(

'SearchIndex' => 'Music',

'Artist' => "$new[0]",

'ResponseGroup' => 'Medium'
));

if ($results->totalResults() > 0) {

foreach ($results as $result) {
if (isset($result->LargeImage)) {
$image = $result->LargeImage->Url->getUri();
}
}
}
?>
<img src="<?php echo $image;?>" width="75" height="75" />

Fumigator
05-08-2009, 08:26 PM
You can loop through the itemSearch code for each element in your $song array.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum