Using PHP, how do I replace the current page with another website, without navigating to a different page, resulting in the browser's Forward and Back buttons becoming enabled.
See Javascript below that achieves this, can PHP do the same?
Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> <script> function leavePage() { location.replace('http://www.google.com/') } var leaveTimeoutID=""; // the global var to hold the timeout id var leaveTime = 5; // seconds function initLeave() { clearTimeout(leaveTimeoutID); // stop the function leaveTimeoutID=setTimeout('leavePage()',leaveTime*1000); // leave in leaveTime seconds // comment or delete next line when you are happy now = new Date(); window.status="leaving in 5 seconds: " + new Date(now.setSeconds(now.getSeconds()+5)) } </script> </head> <body onLoad="initLeave()" onMouseMove="initLeave()"> </body> </html>







Bookmarks