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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.