0

I have the following in my .php file. Just trying a simple search on Flickr. When I visit this .php page in my browser a download dialog pop up. I was expecting to see the json echoed out on the page. I am using WAMP and have url fopen() enabled.If I comment out this code and echo out "WORKING" it does work just fine.

$api_key = "MYKEYHERE";
$tag = 'flower';
$perPage = 25;
$url = 'http://api.flickr.com/services/rest/?method=flickr.photos.search';
$url.= '&api_key='.$api_key;
$url.= '&tags='.$tag;
$url.= '&per_page='.$perPage;
$url.= '&format=json';
$url.= '&nojsoncallback=1';
header('Content-Type:text/json;');
echo file_get_contents($url);

Seems something is wrong somewhere?

1 Answer 1

1

See this previous question that I answered about the same issue:

How can I prevent user-agents from presenting a download window for unrecognized mime types?

Sign up to request clarification or add additional context in comments.

1 Comment

Great little plugin.Worked a treat.Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.