Yes, its possible. Use submit buttons to send the form, and use HTTP_REFERER
from global $_SERVER
array to go back. This is the only way I know without javascript.
But I suggest you to make a javascript check at the page load and tell the user to turn on javascript.
<?php
$back = "https://stackoverflow.com/";
if (!empty($_SERVER["HTTP_REFERER"])) {
$back = $_SERVER["HTTP_REFERER"];
}
?>
<ul class="dropdown-menu">
<li><a href="https://stackoverflow.com/questions/38568996/<?php echo $back; ?>">Português</a></li>
<li><input type="submit" value="Espanhol"></li>
<li><input type="submit" value="English"></a></li>
</ul>
0
solved What is the equivalent history.go(0) in php? [closed]