If you want to use your App only for yourself, you can store the user_token and the user_token_secret also in config file
just add the two new (defined) Variables into the config.php
define(‘USER_TOKEN’, ‘XxXxXxXxXxXxXXxxXX’);
define(‘USER_SECRET’, ‘12345678-YyYyYyYYyyYyYYYyY’);
and edit the line
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token[‘oauth_token’], $access_token[‘oauth_token_secret’]);
to:
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, USER_TOKEN, USER_SECRET);
You also can save all 4 Variables into Database and get 'em by mysql
e.g.:
...
$row = mysql_fetch_assoc($result));
$connection = new TwitterOAuth($row[‘cons_key’], $row[‘cons_sec’], $row[‘usr_key’], $row[‘usr_sec’]);
or you also can set SESSION Variables into the config file, then you dont have to change the code remaining
$_SESSION['access_token']['oauth_token'] = "xxxx";
$_SESSION['access_token']['oauth_token_secret'] = "1234-yyyy";