2017-02-24 37 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

感谢的为。 –