Hello i have one script made by me to read albums from my facebook page and in localhost it works, Im using atspace.me free hosting and when i upload my script to the hosting it doesnt work. Place where ablums should view is blank. I ask my hosting support and they told me because their function json_decode work good, and the problem isnt from them
My php script
[php]$albumi = file_get_contents(“http://graph.facebook.com/$bfbpageid/albums”);
$albumi = json_decode($albumi);
$number = 0;
foreach($albumi->data as $album)
{
$number++;
$album->name;
}
$i = 0;
$number1 = round($number/3 - .5);
while($i <= $number1){
$konecno = $i++ * 3;
echo ‘
’;
$albumi1 = file_get_contents(“http://graph.facebook.com/$bfbpageid/albums?limit=3&offset=$konecno”);
$albumi1 = json_decode($albumi1);
foreach($albumi1->data as $album1){
echo ‘
}
echo ‘
’;$albumi1 = file_get_contents(“http://graph.facebook.com/$bfbpageid/albums?limit=3&offset=$konecno”);
$albumi1 = json_decode($albumi1);
foreach($albumi1->data as $album1){
echo ‘
’;
$get_cover_id = $album1->cover_photo;
$cover = file_get_contents(“http://graph.facebook.com/$get_cover_id”);
$cover = json_decode($cover);
$cover_photo = $cover->source;
’;$get_cover_id = $album1->cover_photo;
$cover = file_get_contents(“http://graph.facebook.com/$get_cover_id”);
$cover = json_decode($cover);
$cover_photo = $cover->source;
echo '<div class="image-caption-wrapper" style="width: 100%"><nostyle><a href="galerija.php?album='.$album1->id.'"><img src="'.$cover_photo.'" height="150" style="width: 100%; max-width: 523px; " alt="an image"></a></nostyle><b><p style="font-size:12px;">'.$album1->name.'</p></b>';
echo '</div>';
echo ‘
}
echo ‘
}[/php]
$bfbpageid is my fb page ID in this place sNeg0rci
Thanks