Empty screen_name in Abraham's TwitterOAuth


#1

I have been using Abraham’s TwitterOAuth for months and it was working ok.
I don’t really know when exactly this problem happened but a few days ago I discovered Twitter Connect in my script isn’t working.

/* If method is set change API call made. Test is called by default. */
$user_info = $connection->get('account/verify_credentials');

    if(isset($user_info->error)){  
        // Something's wrong, go back to square 1  
        header('Location: twitter_login.php'); 
    } else { 
        // Let's find the user by its ID  
        
		$query = "SELECT * FROM members WHERE username ='" .$user_info->screen_name ."'";  
		$result = $conn->execute($query);
        // If not, let's add it to the database  
}

Actually this code results in empty search. So I echoed $user_info->screen_name and found it always returns empty result.
I really don’t know what the problem is.
Any help?


#2

Is there anything in $user_info?


#3

stdClass Object ( [errors] => Array ( [0] => stdClass Object ( [message] => Bad Authentication data [code] => 215 ) ) )


#4

@abraham any hope? :\


#5

Problem is partially fixed.
Since I only needs screen_name value to check the database, I tried to echo $access_token in callback.php file.
I found that screen_name value exists. That solved my problem by moving the rest of my code to callback.php
I hope this may help anyone.
Best Regards


#6