POST data from MySQL...http 403 code + missing parameter: status


#1
  1. I don’t really feel like this is an authentication problem, but the 403 is throwing me off. Quadruple checked keys and permissions.
  2. I can post plain text if I enter it manually, but it won’t post content coming out of the db. (though it’s fetching the right content where I have the echo $tweet)
  3. Using Abraham’s TwitterOAuth
function get_info(){
  $con=mysqli_connect("---","---","---","---") or die('Could not connect to database');
  $result = mysqli_query($con, "SELECT * FROM links WHERE ID='kys1' ORDER BY Postdate DESC LIMIT 1");
  $row = mysqli_fetch_array($result);
  echo $row['Title'], ' ', $row['URL'];
}

$tweet = get_info();
echo $tweet;

$content = $connection->post('statuses/update', array('status' => $tweet));
var_dump($content);

Seen the problem mentioned several times, but no solution on my end. Thoughts on what’s causing it? Or know a better lib to be using for this?


#2

Nvm. Got it.

function get_info(){ $con=mysqli_connect("localhost","showdown_info","B!k012689","showdown_articles") or die('Could not connect to database'); $result = mysqli_query($con, "SELECT * FROM links WHERE ID='kys1' ORDER BY Postdate DESC LIMIT 1"); $row = mysqli_fetch_array($result); echo $row['Title'], ' ', $row['URL']; }

ob_start();
get_info();
$output = ob_get_clean();

$content = $connection->post(‘statuses/update’, array(‘status’ => $output));
var_dump($content);

?>