[Tutorial] Code for a "Browser Back Button" on a Page w/ PHP

reloadmydeagle Feb 13, 2015

  1. reloadmydeagle

    reloadmydeagle I LoVe GoldZ Lifetime Gold XPG Retired Staff
    135/188

    Joined:
    Oct 30, 2013
    Messages:
    1,608
    Likes Received:
    656
    Trophy Points:
    135
    Gender:
    Male
    Location:
    Texas
    Console:
    Xbox One
    Here's how to make a button with PHP that acts like a browser back arrow and take people to the previous page they were on!

    <?php
    $url = htmlspecialchars($_SERVER['HTTP_REFERER']);
    echo "<a href='$url'>back</a>";
    ?>

    Enjoy! ;)
     

Share This Page

Close