2017-02-24 39 views

回答

1

你可以使用一個簡單的形式是這樣的:

<?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> 
+0

謝謝你的代碼 –

+0

不客氣..! – BizzyBob

0

你將不得不使用PHP來創建此網址。 $ url是一個包含表單數據字符串的變量。

<?php 
    echo "<a href='https://twitter.com/intent/tweet?text=" . $url . "'></a>"; 
?> 
+0

感謝的爲。 –