View Single Post
Old 01-30-2008, 01:15 PM   #1 (permalink)
oMIKEo
The Contributor
 
oMIKEo's Avatar
 
Join Date: Jan 2008
Location: Leeds
Posts: 52
Thanks: 7
oMIKEo is on a distinguished road
Default Amazon web services help

Hi, i'm new to this forum but hope you guys can help me out. I'm trying to get some book information from an ISBN number but i cant get any results to print out. The $request has values and so does the $data array but i cant output any of the information...

Here is what ive got so far:
PHP Code:
<? 
$AWSAccessKeyId 
"MY_CODE_HERE";
$AssociateTag =  "";
$Version =  "";
$Operation =  "ItemLookup";
$SearchIndex "Books";
// ItemID: is a test ISBN number
$ItemId =  "1843151022";
$ResponseGroup "Medium";

$requestfile_get_contents("http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=$AWSAccessKeyId&AssociateTag=$AssociateTag&Version=$Version&Operation=$Operation&ItemId=$ItemId&ResponseGroup=$ResponseGroup"); 

include(
'xml.php'); 
$data XML_unserialize($request); 

$error $data[ItemLookupResponse][Items][Request][Errors][Error][Message]; 
$theAuthor $data[ItemLookupResponse][Items][Item][0][ItemAttributes][Author]; 
$theLabel $data[ItemLookupResponse][Items][Item][0][ItemAttributes][Label]; 
$theBinding $data[ItemLookupResponse][Items][Item][0][ItemAttributes][Binding]; 

if (!
$error) { 
    print (

    Author: '
.$theAuthor.'<br />
    Label: '
.$theLabel.'<br /> 
    Binding: '
.$theBinding.''); 

else
{
    die(
$error);

?>
If anyone could help me get the correct results to display that would be great, thanks guys!
Send a message via MSN to oMIKEo
oMIKEo is offline  
Reply With Quote