喜上我想作一個網頁,會問用戶一些文本鳴叫在Twitter上則設置retunred文字的值,然後去鏈接https://twitter.com/intent/tweet?text= $網址腓去URL根據HTML表單
的值$ url將存儲來自HTML表單的信息。
喜上我想作一個網頁,會問用戶一些文本鳴叫在Twitter上則設置retunred文字的值,然後去鏈接https://twitter.com/intent/tweet?text= $網址腓去URL根據HTML表單
的值$ url將存儲來自HTML表單的信息。
你可以使用一個簡單的形式是這樣的:
<?php
if($_POST['text']) {
$text = $_POST['text'];
$url = "https://twitter.com/intent/tweet?text=$text";
header("Location: $url");
exit;
}
?>
<html>
<form method="post">
<textarea name="text"></textarea>
<button type="submit">Post to Twitter</button>
</form>
</html>
你將不得不使用PHP來創建此網址。 $ url是一個包含表單數據字符串的變量。
<?php
echo "<a href='https://twitter.com/intent/tweet?text=" . $url . "'></a>";
?>
感謝的爲。 –
謝謝你的代碼 –
不客氣..! – BizzyBob