I am trying to implment the share button on my website, but it does not work when I use php. However it does work when I input the data manunaly.
for example this works:
<a href="http://www.tumblr.com/share/link?url=https%3A%2F%2Fdomain.com&name=test&description=test">Share on Tumblr</a>
but this does not:
<a href="http://www.tumblr.com/share/link?url=<?=urlencode(current_url())?>&name=test&description=test">Share on Tumblr</a>
When I click on the one using PHP I get redirected to:
https://www.tumblr.com/widgets/share/tool/banned?
EDIT: I even tried doing it this way:
var tumblr_link_url = '<?=current_url()?>';
var tumblr_link_name = 'test';
var tumblr_link_description = 'test';
var url = "http://www.tumblr.com/share/link?url=" + encodeURIComponent(tumblr_link_url) + "&name=" + encodeURIComponent(tumblr_link_name) + "&description=" + encodeURIComponent(tumblr_link_description);
var tumblr_button = document.createElement("a");
tumblr_button.setAttribute("href", url);
tumblr_button.setAttribute("title", "Share on Tumblr");
tumblr_button.innerHTML = "Share on Tumblr";
document.getElementById("tumblr_button").appendChild(tumblr_button);
but it still does not work. It definitely has something to do with using PHP. My other share buttons work, it's only the Tumblr share button that has this problem when using PHP
Any reason why this does not work?