-1
   echo ("<SCRIPT LANGUAGE='JavaScript'>
           window.alert('Succesfully Updated')
           </SCRIPT>");

this is my code i want it to redirected in my previous page and had it refresh.

Kamil Budziewski
  • 22,699
  • 14
  • 85
  • 105

1 Answers1

-1
<script>
window.location = document.referrer;
</script>
jeoj
  • 633
  • 6
  • 9
  • what if 2 previous page? thankss – lhei pelaez Sep 17 '15 at 07:54
  • With refresh, I don't think you can do that, since document.referrer only refers to the URL where you came from to your current url. You can go back two pages by window.history.go(-2), but that won't refresh the page, and for security reasons, you can't get the URLs from window.history: if you could get previous URLs, you could possibly steal session tokens that were kept in the address bar. – jeoj Sep 17 '15 at 08:06