Return to Snippet

Revision: 43485
at March 25, 2011 00:35 by mentaljason


Initial Code
<?php
$ref = getenv ("HTTP_REFERER");
if (strlen($ref) <= 1) {echo '<a href="../">&gt; Home</a>';}
else {echo '<a href="'.$ref.'">&gt; Back</a> | <a href="../">&gt; Home</a>';}
?>

Initial URL


Initial Description
Simple, It gets the referer and if there wasn't a referer it displays just the home link, but when there is a referer it dispays both back and home, I personaly use this on my 404 page.

Initial Title
Very simple back & home links ( Referer )

Initial Tags
link, simple

Initial Language
PHP