getRequestToken(TW_CALLBACK_URL); if(!isset($token['oauth_token'])){ echo "エラー"; exit; } //エラーがなかったら $_SESSION['oauth_token'] = $token['oauth_token']; $_SESSION['oauth_token_secret'] = $token['oauth_token_secret']; //twitter認証画面へ $oauthURL = $tw->getAuthorizeURL($_SESSION['oauth_token']); header('Location: ' . $oauthURL); ?>