0 down vote favorite
I am trying to share my products image on Facebook but somethings gos wrong with the URL of the products I used this code on the header of the page
(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));
and than I used this for my share Icon
<a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo "https%3A%2F%2F$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; ?>" target="_blank"><img src="images/facebook.png" class="f_right m_left_right_5px" width="30" height="30" alt="facebook"/></a>
I used this PHP code to get the link of the products
https%3A%2F%2F$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]
the link should appear something like this
but in the share box it appear like that
https://nadim.org/new2/index.php?pid=v4
what did I made wrong. thanks