i am trying following code to display my user name when logged in to flickr.I tried a lot of things but it just dont show the username.
require 'phpflickr/phpflickr.php';
$api_key = "xxxxxxx";
$secret = "xxxxxxxx";
$perms = "read";
// Clear the token if it is set
if( isset($_SESSION['phpFlickr_auth_token']) )
unset($_SESSION['phpFlickr_auth_token']);
// Grab the authentication redirect if it is set
if( isset($_SESSION['phpFlickr_auth_redirect']) &&
!empty($_SESSION['phpFlickr_auth_redirect']) ) {
$redirect = $_SESSION['phpFlickr_auth_redirect'];
unset($_SESSION['phpFlickr_auth_redirect']);
}
$f = new phpFlickr($api_key, $secret, true);
$userData = $f->auth_checkToken($_SESSION['phpFlickr_auth_token']);
if ($f->getErrorMsg() !== false) {
die("Error: ".$f->getErrorMsg());
}
$userNSID = $userData['user']['nsid'];
echo $userNSID;
i get a frob token in the url when returning from logging in and from there it does nothing.