To return to the previous page, I have a prepared button:
& lt; input class = "buttonSend" onclick = "window.history.back ();" type = "button" value = "Go back" / & gt;
How can I refresh the page I returned to after completing the return?
I tried to add it like this:
echo "& lt; script language = 'JavaScript' type = 'text / javascript' & gt; window.location.replace (' http: //homka/mypage/index.php ') & lt; / script & gt; ";
But the update happens instantly, without going to the page where I have information about the execution of the script and the “Go Back” button.
Answer 1
Option # 1 (JS)
echo '& lt; script & gt; SetTimeout (function () {window.location.replace ("http: // homka / mypage /index.php ");}, 1000); & lt; / script & gt; ';
1000 is 1 second in milliseconds. After 1 second, the page will refresh.
Option # 2 (HTML)
echo '& lt; meta http-equiv = "Refresh" content = "10; URL = http: // homka / mypage /index.php"> ';
Works similarly to the first option, but here (in content
) you specify seconds, not milliseconds.