if (!empty($_POST['twitnam'])) {
$message = $_POST['message'];
$TwitterUsername = $_POST['twitnam'];
$tw_sql = mysqli_query($connection, "SELECT oauth_token,oauth_token_secret FROM TwitterUpdate WHERE uname='$TwitterUsername'");
$row = mysqli_fetch_array($tw_sql, MYSQLI_ASSOC);
$oauth_token = $row["oauth_token"];
$oauth_token_secret = $row["oauth_token_secret"];
if (strlen($oauth_token) > 0 && strlen($oauth_token_secret) > 0) {
$Twitter = new EpiTwitter($consumer_key, $consumer_secret);
$Twitter->setToken($oauth_token, $oauth_token_secret);
$status = $Twitter->post_statusesUpdate(array('status' => $message));
echo $status->id_str;
}
}
every time i try to run the script i got:
Fatal error: Uncaught exception 'EpiTwitterNotAuthorizedException' with message '{"errors":[{"message":"Could not authenticate you","code":32}]}' in /****/EpiTwitter/EpiTwitter.php:254 Stack trace: #0 /*****/EpiTwitter/EpiTwitter.php(217): EpiTwitterException::raise(Object(EpiCurlManager), false) #1 /*****/EpiTwitter/EpiTwitter.php(118): EpiTwitterJson->__get('response') #2 /******/EpiTwitter/EpiTwitter.php(100): EpiTwitter->request('POST', '/statuses/updat...', Array) #3 /*****/fbmain.php(98): EpiTwitter->__call('post_statusesUp...', Array) #4 /*****/fbmain.php(98): EpiTwitter->post_statusesUpdate(Array) #5 /****/index.php(17): in /*****/EpiTwitter/EpiTwitter.php on line 254
pls fix the error.