![]() |
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:
|
Hi oMIKEo, welcome to TalkPHP :-)
The problem with your code looks to be when you are trying to get the values from your $data array. Your Amazon request only returns a single item so there is no need to specify [0] when accessing the item attributes. For example, changing that block of your code to: PHP Code:
Code:
Author: Louis Fidge |
Thanks for the fast reply Alan,
That works a treat, I knew I wasn't too far off :) |
I'm having a problem with this code now on another machine, im running it locally using the same code but now its not working and i get the following error:
Quote:
can your internet connection cause this error? |
file_get_contents is certainly not allowed from local to internet.
Download the xml file, put it in your local folder and try again, changing the url passed to your file_get_contents function. If a such access could be possible, it would be too easy to hack a website ;) |
file_get_contents() does support opening of remote files from the local machine - I use it here on my local laptop all the time - just need to make sure that the fopen wrappers are enabled :-)
Mike: Are you able to try using file_get_contents() to open another website/url from the new machine? It looks to me like a firewall or somthing may be blocking it, or perhaps Amazon was just down or on a go slow when you tested it? Alan |
Aside from your data retrieval problems
PHP Code:
PHP Code:
|
| All times are GMT. The time now is 01:25 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0