dan-coulter / phpflickr

PHP Wrapper for the Flickr API
GNU General Public License v2.0
207 stars 128 forks source link

The example.php doesnt work #25

Closed locvfx closed 2 years ago

locvfx commented 10 years ago

Return Blank page in browser ! Note: I configured Flickr API probably and phpflckr.php is in correct path

svetoslavp99 commented 10 years ago

Hey, I also installed api correctly and get correct frob. And then if I call auth_getToken function, there's no token registered.

Do I have to pre-install something?

playcat commented 10 years ago

Example isn't working because it's buggy - seems like developers didn't test it :) So, instead of "foreach ($recent['photo'] as $photo) {" in line 17 you should have foreach ($recent['photos']['photo'] as $photo) {

ghost commented 9 years ago

I keep getting a blank page as well when trying the example.. Tried suggestion by playcat and still nothing, any other ideas?

asrin475 commented 9 years ago

Just try by adding or replacing these lines of code in phpFlickr.php -> function post()

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $this->rest_endpoint);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);               
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);  

this is what I tried and worked well.

elyorbegmurod commented 8 years ago

still a blank page. solution of asrin475 didnot work

anupam82 commented 7 years ago

asrin475 did work for me. I was able to successfully retrieve the access token and upload image as well.