I am trying to access flickr images using api key and secret key. After searching it i got a zip file from the link . After giving apikey and secret key in the example.php file i m getting a Warning i.e
Warning: Invalid argument supplied for foreach() in C:\wamp\www\phpFlickr-3.1\example.php on line 21
Here is the example code which i m trying:
require_once("phpFlickr.php");
$f = new phpFlickr($api_key);
$recent = $f->photos_getRecent();
foreach ($recent['photo'] as $photo) {
$owner = $f->people_getInfo($photo['owner']);
echo "<a href='http://www.flickr.com/photos/" . $photo['owner'] . "/" . $photo['id'] . "/'>";
echo $photo['title'];
echo "</a> Owner: ";
echo "<a href='http://www.flickr.com/people/" . $photo['owner'] . "/'>";
echo $owner['username'];
echo "</a><br>";
}
please help me i m trying to do this code from past 3 days but nothing works :(.
You need an online server to try the code you are using since you want to test flick api. It is correct but you have to buy a server for a couple of hours just to try your code. A good suggestion is https://www.digitalocean.com