Sharing a URL with a query string on Twitter
This will Work For You
http://twitter.com/share?text=text goes here&url=http://url goes here&hashtags=hashtag1,hashtag2,hashtag3
Here is a Live Example About it
http://twitter.com/share?text=Im Sharing on Twitter&url=https://stackoverflow.com/users/2943186/youssef-subehi&hashtags=stackoverflow,example,youssefusf
This can be solved by using https://twitter.com/intent/tweet
instead of http://www.twitter.com/share
. Using the intent/tweet
function, you simply URL encode your entire URL and it works like a charm.
https://dev.twitter.com/web/intents
Use tweet web intent, this is the simple link:
https://twitter.com/intent/tweet?url=<?=urlencode($url)?>
more variables at https://dev.twitter.com/web/tweet-button/web-intent