Tweet share button missing off GET parameters
Any idea why when i click the Tweet button, it only takes the URL of http://www.humanisms.co.uk/single.php. And misse开发者_JAVA百科s everything after this! Any ideas how i can get around this?
echo "<a href='http://twitter.com/share?url=http://www.humanisms.co.uk/single.php?id='".$row['id']."'&via=humanisms_uk&text=Humanisms' class='twitter-share-button'>Tweet</a>";
Probably because you are using the query string delimiter ?
twice, which is invalid. You have to url-encode it, along with &
. In fact, you're better off encoding the whole thing:
$url = rawurlencode("http://www.humanisms.co.uk/single.php?id={$row['id']}&via=humanisms_uk&text=Humanisms");
echo "<a href='http://twitter.com/share?url=$url' class='twitter-share-button'>Tweet</a>";
I also noticed you had quotes around the id
parameter, not sure if that was intentional or not.
精彩评论