Twitter Status Update Script (HTML/PHP)

Your Twitter™ ID/email address :
Your Twitter™ password :
Status :

Tweet.html

 <html> 
 <head>
 </head>
 <body>
 <table cellpadding="8">
 <tr><td>
 <form action="http://lazerzap.com/tweetit.php" method="POST">
 <label>
 </td></tr></table>
 <table cellpadding=5>
 <tr><td align=right>
 Your Twitter&#0153 ID/email address :
 </td><td align=left>
 <input type="text" size="28" name="twusername" id="twusername" /> 
 </td></tr><tr><td align=right>
 Your Twitter&#0153 password :
 </td><td align=left>
 <input type="password" size="28" name="twpassword" id="twpassword" />
 </td></tr><tr><td align=right>
 Status :
 </td><td align=left>
 <input type="text" size="140" name="twstatus" id="twstatus" /> 
 </td></tr><tr><td></td><td align=right>
 <input type="submit" name="SubmitForm" id="submit" value="Send" />
 </form>
 </td></tr></table>
 </body>
 </html>

Tweetit.php

 <?php 
 $username = $_POST["twusername"];
 $password = $_POST["twpassword"];
 $status = $_POST["twstatus"];
 $postvars = "status=".$status;
 $url = "http://twitter.com/statuses/update.xml";
 $ch = curl_init($url);
 curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
 curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
 curl_setopt($ch, CURLOPT_POST, 1);
 curl_setopt($ch, CURLOPT_POSTFIELDS, $postvars);            
 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
 curl_setopt($ch, CURLOPT_HEADER, 0);  // DO NOT RETURN HTTP HEADERS
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);  // RETURN THE CONTENTS OF THE  CALL
 $res=curl_exec($ch);
 curl_close($ch); 
 echo 'Tweet Sent - <a href="#" onclick="history.back();">Back</a>';
 ?>













Bookmark this on Delicious

SEO-AU Links Best INFP Websites - Click here to Vote for this site!