Trying to retrieve a user's name


#1

hi all i’m trying to retrieve and display the user’s name after he/she has logged in/redirected from Twitters authentication.

But when i use print_r($user_info); i got “[error] => Could not authenticate you” along with oauth_signature_method info, oauth_version info etc.
so i was wondering if i did not get the users information correctly.

// TwitterOAuth instance, with two new parameters we got in twitter_login.php $twitteroauth = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']); // Let's request the access token $access_token = $twitteroauth->getAccessToken($_REQUEST['oauth_verifier']); // Save it in a session var $_SESSION['access_token'] = $access_token; // Let's get the user's info $user_info = $twitteroauth->get('account/verify_credentials'); // Print user's info print_r($user_info);

What i have noticed is i dont seem to have “oauth_verifier” after getting redirected from Twitters authentication. Or is there something missing in my code?
Thanks for looking.


#2

never mind stupid me lol solved everything. just before this page (after redirecting from twitter) i had a page with similar coding and unset statements passing in my tokens as parameters -_-