Anyone knows the logic or knowledge to do this thing ? I have 5 html/php pages and a menu page, in the menu page there is a buttons that lead to 5 pages and a button that will direct to the last page viewed by the user.
You can easily do this with javascript: <a href="javascript:history.back();">Back</a>
Create a JavaScript function that sends the browser back
function goBack() {
window.history.back()
}
Then create a button that the user clicks
<button onclick="goBack()">Go Back</button>
Php:
<a href="<?php echo $_SERVER['HTTP_REFERER']; ?>">Back</a>