sufian Posted July 26, 2009 Share Posted July 26, 2009 Hey I have found this script for twitter but it only lets you type in your username and password for twitter in the php file I need help to make it so their is a section for login and password and when you can tweet. on the page not in the backend. So far its a text box with a post button I want it so its a login password section and login button and then the post area with the text box and post button. <?php /* ---------------------------------------- */ // Change these parameters with your Twitter // user name and Twitter password. /* ---------------------------------------- */ $twitter_username ='username'; $twitter_psw ='password'; /* ---------------------------------------- */ /* Don't change the code belove /* ---------------------------------------- */ require('twitterAPI.php'); if(isset($_POST['twitter_msg'])){ $twitter_message=$_POST['twitter_msg']; if(strlen($twitter_message)<1){ $error=1; } else { $twitter_status=postToTwitter($twitter_username, $twitter_psw, $twitter_message); } } /* ---------------------------------------- */ ?> <!-- This is the form that you can reuse in your site --> <?php if(isset($_POST['twitter_msg']) && !isset($error)){?> <div class="msg"><?php echo $twitter_status ?></div> <?php } else if(isset($error)){?> <div class="msg">Error: please insert a message!</div> <?php }?> <p><strong>What are you doing?</strong></p> <form action="insertTwitterMsg.php" method="post"> <input name="twitter_msg" type="text" id="twitter_msg" size="40" maxlength="140" /> <input type="submit" name="button" id="button" value="post" /> </form> <!-- END --> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.