Jump to content

Show Referrer?


ZachEdwards

Recommended Posts

I am trying to use this code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>404 - Page Not Found</title>
<style type="text/css">
<!--
.style1 {font-family: "Century Gothic"}
-->
</style></head>

<body>
<div align="center">
  <p class="style1">Looks as if you have stumbled across a missing link.</p>
  <p class="style1">
  <?PHP
  $referreromg = $websiteaddress.getenv("REQUEST_URI");
  echo '<A HREF="'.$referreromg.'>Go Back to Last Page.</a>';
  ?>
</div>
</body>
</html>

 

on a 404 page.

 

It shows the current page's URL.

 

I want it to show the URL of the last page visited.

 

Let's say I go to:

test.com/valid.html [valid link]

Then I go to

test.com/invalid.html [invalid link]

 

I want it to say on the 404 page:

test.com/valid.html

 

-Zach

Link to comment
https://forums.phpfreaks.com/topic/86809-show-referrer/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.