I am using this code to generate access token:
if(isset($_POST['login_tw'])) {
$request_token = $connection->getRequestToken($_REQUEST['oauth_verifier']);
if($request_token) {
$token = $request_token['oauth_token'];
$_SESSION['request_token'] = $token ;
$_SESSION['request_token_secret'] = $request_token['oauth_token_secret'];
if($connection->http_code = 200)
{
$url = $connection->getAuthorizeURL($token);
header('Location: ' . $url);
$fp=fopen('config.php','w');
fwrite($fp, '<?php
$acsstok = "' . $_SESSION['request_token'] . '";
$scrtaccstok = "' . $_SESSION['request_token_secret'] . '";
?>');
fclose($fp);
}
But the generated token can't be used for anything, especially to get a list of other user followers.
And the access token format is not like the one that is generated from 'Application Management' page that have leading numbers like this:
340708911-xVcFcjVjkdksfdrjhgjdfyhjdfhjdhdfkdjgkfvaJ
But it have no leading numbers like this:
xVcFcjVjkdksfdrjhgjdfyhjdfhjdhdfkdjgkfvaJ
What's wrong with the code above and how should it be so I can use the generated access token in my app?
Can somebody here help me? I have spending 1 day to find the solution for that problem.
Best Regards