Posting direct messages


This is driving me up the wall! I’m trying to make a simple little Twitter app.

I make the connection to twitter, validate with credentials, etc and able to post a tweet like this:

array(‘status’ => $tweet_text));

but when I try to do a direct message, the PHP script seems to hang at this spot:

I’ve tried it this way:
$connection->post(‘1/direct_messages/new’, array(‘text’ => ‘dm text here’, ‘FROM_TWITTER_NAME’ => ‘TO_TWITTER_NAME’));

I’ve also tried this:
$method = ‘direct_messages/new’;
$receiverScrName = “SCREEN_NAME”;
$parameters = array(‘screen_name’ => $receiverScrName, ‘text’ => ‘how are you’);
$connection->post($method, $parameters);

The upper case text is valid twitter names.
this should be the picture of simplicity and yet I’m about to pull my hair out! Any help would be greatly appreciated!