嗨,伙计们,基本上我有一个叫做$content[Ttopic]的东西,它在php中显示的主题可能是"Platformers What Are They"
但当用户点击我的推特共享按钮时,它只会显示"平台[链接]",而不是我想要显示的整个标题,我该如何更正?
这是我使用的共享按钮的代码
<a href=https://twitter.com/intent/tweet?url=http://www.sentuamessage.com/blog.php?who=$content[id]&text=$content[topic]&hashtags=blogs,SentUAMessage target=new>Image Here</a>
有什么想法吗?
您需要对所有变量进行URLen编码。
在你的情况下,做一些类似…的事情。。。。
$URL = "https://twitter.com/intent/tweet?"
+ "url=" + urlencode("http://www.sentuamessage.com/blog.php?")
+ "&who=" + urlencode($content[id])
+ "&text=" + urlencode($content[topic])
+ "&hashtags=" + urlencode("blogs,SentUAMessage");
基本上,确保所有内容都正确编码。