I have the below code as part of php includes on my webpage. The code simply opens the fb page in a new window and share the page url.
The page url is currently static but i need to dynamically update it depending on the page its called upon.
facebook share
I tried -- echo "$_SERVER['REQUEST_URI']"; see code below but didnt work.
<a href="https://www.facebook.com/sharer/sharer.php?u=http://bigbenfitness.in<?php echo "$_SERVER['REQUEST_URI']"?>" onclick="window.open(this.href,'targetWindow', 'toolbar=no, location=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=500px, height=500px'); return false;" class="sprite facebook-45px"><span class="hidden">facebook share</span></a>
I'm not sure how to do this in javascript.