Thanks Alex. After looking into this further, I eventually found the
following PHP/curl snippet that seems to plug into the status update
API very well and do what I was trying to do. I tested it and it
works, even authenticates, but lacks the actual html text area where
the user (really just me) would enter the text to post from a web
page. (Instead it just has a default message on the "$message =" line
below so always posts the same message to Twitter) I think it's a
simple matter of placement of the html snippet for a text area. Would
you agree? If so, where in your opinion would I insert a vanilla text
area in or around this code below? Thanks for your patience with me on
this.
<?php
// Set username and password
$username = 'username';
$password = 'password';
// The message you want to send
$message = 'is twittering from php using curl';
// The twitter API address
$url = '
http://twitter.com/statuses/update.xml';
// Alternative JSON version
// $url = '
http://twitter.com/statuses/update.json';
// Set up and execute the curl process
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, "$url");
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_POST, 1);
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, "status=$message");
curl_setopt($curl_handle, CURLOPT_USERPWD, "$username:$password");
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
// check for success or failure
if (empty($buffer)) {
echo 'message';
} else {
echo 'success';
}
?>