I am trying to implement a link that will take me back to the page it last came from. So on site A I submit a form and it goes to site B where when a link is clicked it should go to site A.
here are the code for the two pages. site A:
<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<a href="http://www.example.com/testbackpage2.html">link to page 2</a>
<p>My first paragraph.</p>
</body>
</html>
site B:
<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<script type="text/javascript">
var ex=document.referrer;
document.write(ex);
</script>
<a href="ex">go back to page one</a>
<p>My first paragraph.</p>
</body>
</html>
</body>
</html>