I'm not a JavaScript guru. I do know that the last page in history can be accessed via JavaScript like this:
CODE
history.go(-1)
so if you can find a way to feed that to a redirect in JavaScript, you're set.
You could do it with PHP, too. When clicking a link, this will give you the page that the user came from:
CODE
$_SERVER['HTTP_REFERER']
which you could then feed to header() like so:
CODE
<?php
header('Location: ' . $_SERVER['HTTP_REFERER']);
?>
The problem is that header()
does not work if any text (i.e. html coding) has been written to the HTTP stream already. In other words, you can't send part of a webpage and
then use header() to redirect.
Maybe this will give you a place to start, though.