Top Button with a Base Href defined

If you have base href defined in your pages and need to add a top button to all your pages, you can use the following code snippet to make the top links work using PHP.

< a href="< ?php echo $_SERVER['PHP_SELF'] . "?" .
  $_SERVER['QUERY_STRING'] ?>#top">Top< /a>

This avoids the redirect that usually happens, and jumps to the span/div link on the page it’s defined at.


Leave a comment

Your comment