horseatingweeds Posted August 18, 2007 Share Posted August 18, 2007 I'm having trouble getting this function to work. I'm trying to make this page, after opening and running a php mail(), to forward to another page. <script language="javascript" type="text/javascript"> function forward() { var localTime = new Date(); if (localTime == (localTime + 2)) { window.location = window.location.history.go(-2); } } </script> <body onload="forward()"> Link to comment https://forums.phpfreaks.com/topic/65613-help-with-a-forward-after-seconds-function/ Share on other sites More sharing options...
php_tom Posted August 18, 2007 Share Posted August 18, 2007 First of all you can't add 2 to a date object... localTime + 2 And even if you tested the hour or something, it still wouldn't work, because [i != (i + 2)] [ever ] Please explain what exactly you're trying to do. Link to comment https://forums.phpfreaks.com/topic/65613-help-with-a-forward-after-seconds-function/#findComment-327674 Share on other sites More sharing options...
horseatingweeds Posted August 18, 2007 Author Share Posted August 18, 2007 I've figured it out: <body onload="setTimeout('history.go(-2);', 2000)"> simple enough. Link to comment https://forums.phpfreaks.com/topic/65613-help-with-a-forward-after-seconds-function/#findComment-327678 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.