My code:
function jsonCall()
{
global $_SESSION;
global $smarty;
$client_id = "XXXXXXXX";
$next_max_tag_id = 1349756086082;
if(isset($_POST['nextSubmit']))
{
$next_max_tag_id = $_POST['next_max_tag_id'];
}
$url ='https://api.instagram.com/v1/tags/' . $_SESSION['zoekterm'] . '/media/recent?access_token=145408254.f59def8.448ef83c8fa740aa9744a0c47766a857&max_tag_id=' . $next_max_tag_id;
$json = file_get_contents($url);
$json_output = json_decode($json,true);
file_put_contents('json/instagram.json',$json);
$imagesErbuiten = array();
foreach($json_output['data'] as $data)
{
foreach($data['images'] as $images)
{
array_push($imagesErbuiten, $images);
}
}
$smarty->assign('arrData',$imagesErbuiten);
$smarty->assign('next_max_tag_id',$json_output['pagination']['next_max_tag_id']);
}
I am working with the Instagram API and Flickr API. Both get same errors when there is a value they don't know in their searchfield.
As an example:
Instagram doesn't allow searches by tag like porn, tits, ... When this happens you get the 400 Bad request. When you search for QSDFQSDFQSDFQSDF (which doesn't exist ether) there is no error, just because the search is valid but the array is empty (which is good, so i can display "Nothing has been found").
It's not a empty space problem. I allready excluded all empty spaces and replaced them with a +.
My question:
Is it possible to just drop or fix this error? Everything works fine, except you get that ugly error at the top of my page.
Greetings, W.