Create a “back” button with PHP
Deziner Folio posted this PHP snippet for creating a simple back link that will take you to the previous page you were on.
Code:
-
-
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
-
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
-
-
<a href=”<?php echo $_SESSION[’back’]; ?>“>back</a> <!–The anchor tag that links to the previous page –>
-
-
<?php $_SESSION[’back’] = $_SERVER[’REQUEST_URI’]; ?> <!– Assigning the current URL to a session variable –>
Please note that first we assign the previous session variable to the anchor tag and only then re-assign the current URL to the session variable which will be read when you move on to the next page.
This being a simple PHP snippet can be used in almost every CMS (PHP based) and sure is a good addon to the accessibility of your site.
You can view the original article here

My name is Noah Everett. I live in Tulsa, OK. I started 