My code is:
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 Instagram API and Flickr API. Both get the same error when there is a value that they do not know in their search field.
As an example:
Instagram does not allow searches by tags like porn, boobs, ... When this happens, you will receive 400 Bad requests. When you search QSDFQSDFQSDFQSDF (which ether does not exist), there is no error, just because the search is valid, but the array is empty (this is good, so I can display "Nothing was found").
This is not a problem with empty space. I allready excluded all empty spaces and replaced them with +.
My question is:
Can I just remove or fix this error? Everything works fine, except that you get this ugly error at the top of my page.
Hi Tue
json php request
Warre buysse
source share