進出口工作嘗試使用下面的PHP的最愛我的帳戶:PHP後不與Twitter的API
<?php
if(isset($_POST['submit'])) {
$fav = $_REQUEST['fav'];
$connection->post('favorites/create', array('id' => $fav));
echo "<div style='padding-bottom: 5px; color: #0099FF;'>Fav Created Successfully.</div>";
}
?>
通過以下形式:
<form id="fav" method='post' action='index.php'>
<input type="text" style="width: 346px;" name="fav" id="fav" ></input>
<input type="submit" value="Fav This!" name="submit" id="submit" />
</form>
它不是建立一個喜歡的,任何人都可以發現它有什麼問題嗎?
PS:我使用的是OAuth的API:
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']);
他正在通過'array('id'=> $ fav)'來做這件事。 – shamittomar 2010-09-05 16:47:11
我得到了ID但錯誤地構建了URL。 – CLiown 2010-09-05 17:39:31