开发者

How to store twitter oauth details in mysql database?

I am developing a basic twitter oauth app! Here's the code -

$twitterObj = new EpiTwitter($consumer_key, $consumer_secret);
$oauth_token = $_GET['oauth_token'];
    if($oauth_token == '')
      { 
        $url = $t开发者_如何学编程witterObj->getAuthorizationUrl();
        echo "<div style='width:200px;margin-top:200px;margin-left:auto;margin-  right:auto'>";
        echo "<a href='$url'>Sign In with Twitter</a>";
        echo "</div>";
     } 
    else
      {
        $twitterObj->setToken($_GET['oauth_token']);
        $token = $twitterObj->getAccessToken();
        $twitterObj->setToken($token->oauth_token, $token->oauth_token_secret);     
        $_SESSION['ot'] = $token->oauth_token;
        $_SESSION['ots'] = $token->oauth_token_secret;
        $twitterInfo= $twitterObj->get_accountVerify_credentials();
        $twitterInfo->response;
        $username = $twitterInfo->screen_name;
        $profilepic = $twitterInfo->profile_image_url;
        include 'update.php';

     } 

so now tell me the coding process how can I save the user login details!


Encrypt the auth token and its secret and store them in the database encrypted. See here for more information

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜