JohnOP Posted November 20, 2011 Share Posted November 20, 2011 Hi i am looking for a bit of help on a script i am trying to make. Basically i have a page when onload it opens a popup with a random website pulled from the database <script language="JavaScript1.1"> <!-- function TheNewWin(url) { var popUp = window.open(url,'popup','height=700,width=700,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=0,top=200'); if (popUp == null || typeof(popUp)=='undefined') { var a = confirm('Please disable your pop-up blocker and click the "Open" link again.'); if (a){ window.location.href = 'popupwarn.php'; }else{ window.location.href = 'popupwarn.php'; } } else { popUp.focus(); } } //--> </script> <body onload="TheNewWin($website);"> After 10 seconds i have it refresh so the popup changes to a new website header("refresh: 10; websiteviewcontrol.php?id=$website"); What i want to happen is before it changes the popup to a new website i want it to redirect to some website of my choice for example Facebook. So on the 8th second it would go to Facebook then after the 10 it would just reload and get the random website again. The problem im having is i cant get "Some Website" to open in the popup for a few seconds before the reload. Quote Link to comment https://forums.phpfreaks.com/topic/251512-php-popup-redirect/ Share on other sites More sharing options...
JohnOP Posted November 21, 2011 Author Share Posted November 21, 2011 Anyone any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/251512-php-popup-redirect/#findComment-1289883 Share on other sites More sharing options...
WebStyles Posted November 21, 2011 Share Posted November 21, 2011 I would change the script and send in two parameters: Website and timeout... so instead of: <body onload="TheNewWin($website);"> you would have something like: <body onload="TheNewWin($website,$timeout);"> That way you don't actually call your random websites for 10 seconds, you call them for 8, and then call your 'separator' page for 2 seconds, which in turn will call another random website when the time is up... Hope this helps. Quote Link to comment https://forums.phpfreaks.com/topic/251512-php-popup-redirect/#findComment-1289962 Share on other sites More sharing options...
JohnOP Posted November 21, 2011 Author Share Posted November 21, 2011 I think i understand what you mean but what would the $timeout variable be? i would still need to put the $website variable in the header refresh so it can refresh every 10 seconds but what would the $timeout declare as. I think i need something like this but i can't get the header() to push the 'Seperator' in to the TheNewWin popup that is already opened <?php header("resfresh 8; $seperator"); //Put that into TheNewWin header("refresh 10; websiteviewcontrol.php?id=$website"); // will put a new website in TheNewWin Quote Link to comment https://forums.phpfreaks.com/topic/251512-php-popup-redirect/#findComment-1290210 Share on other sites More sharing options...
JohnOP Posted November 24, 2011 Author Share Posted November 24, 2011 Friendly Bump Quote Link to comment https://forums.phpfreaks.com/topic/251512-php-popup-redirect/#findComment-1290894 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.