I was thinking this would be an easy Task, i still believe it is, but without PHP knowledge it is impossible to do correctly.
I try to add to an Link the active uri.
<a onclick="popUpWin(this.href, 'console', 660, 425, 50, 50);return false;" href="http://www.facebook.com/sharer.php?u=<?php echo $_SERVER['REQUEST_URI']; ?>"><img src="<?php bloginfo('url'); ?>/images/facebook.png" alt="Facebook" width="20" height="20" border="0" /></a>
If a user is on the main site he has the correct url in the Link, if he is in a posting he also has it.
But whatever i Try like this Actual Code i posted above, or this
echo “<?php bloginfo(‘url’); ?>”;
echo “<?php the_permalink() ?>”;
instead of <?php echo $_SERVER[‘REQUEST_URI’]; ?> — it all isn’t function, could someone tell me where i do wrong? and how I could fix that, without using any kind of Plugin?
- The topic ‘Request URI’ is closed to new replies.