0
I have this php and js code on the login page, it redirects to another page after 4 seconds, but I wanted it to redirect to the previous or source page that had sent the user to this login page. How to do it, because I’ve tried it many times and I can’t do it.
Follow the code below:
$clubeSorte->mensagemSucesso("Login feito com sucesso! Será redirecionado brevemente. Se não for redirecionado clique <a href='".URL_PESQUISA."'>aqui</a>");
?>
<script>$(document).ready(function(){
function redirect(){
window.location = "<?php echo URL_PESQUISA; ?>";
}
setTimeout(redirect, 4000);
});</script>
Maybe
window.history.go(-1);
in javascript help you.– Benilson
Ok worked but I had to put window.history.go(-2); ... By the way I had already tested this but it must have been wrong or wrong. Thank you very much.
– Meireles