davelr45 Posted August 20, 2007 Share Posted August 20, 2007 I need to "remove" users from a web page at a specific time without the user making an action. I was thinking something with session_destroy and meta refresh but it has to happen at 11am the users are logged in to the page with a session.....any ideas? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/65810-close-browser-window-or-redirect-at-specific-time/ Share on other sites More sharing options...
php_tom Posted August 20, 2007 Share Posted August 20, 2007 Put a session variable of when the user should be booted (like a timestamp). Then check for it in every page, if the time is greater than the timestamp, kill the session. Quote Link to comment https://forums.phpfreaks.com/topic/65810-close-browser-window-or-redirect-at-specific-time/#findComment-328811 Share on other sites More sharing options...
davelr45 Posted August 20, 2007 Author Share Posted August 20, 2007 I need to "remove" users from a web page at a specific time without the user making an action. I was thinking something with session_destroy and meta refresh but it has to happen at 11am the users are logged in to the page with a session.....any ideas? Thanks. More specific: I need them to be removed without any action, this is a single page with a video feed they are essentially "sitting" on this one page watching a video. The problem we are running into is that users are keeping that page open beyond the time that is allocated to their specific video, and tying up bandwidth for other viewers. Quote Link to comment https://forums.phpfreaks.com/topic/65810-close-browser-window-or-redirect-at-specific-time/#findComment-328850 Share on other sites More sharing options...
trq Posted August 20, 2007 Share Posted August 20, 2007 You'll need to look at Javascript, php can't close a browser window, it doesn't even know what a browser is as it runs on the server. Quote Link to comment https://forums.phpfreaks.com/topic/65810-close-browser-window-or-redirect-at-specific-time/#findComment-328853 Share on other sites More sharing options...
php_tom Posted August 20, 2007 Share Posted August 20, 2007 Thorpe is right, you need to use JS. But how will you know how long to wait before redirecting/closing the window? It will depend on the clients connection speed, buffering rates, etc... I really don't know how you will do this without kicking a user off before they have finished watching the movie... You need to figure something else out, maybe like keeping a bandwidth counter in a session variable and using PHP filesize()... I dunno. Quote Link to comment https://forums.phpfreaks.com/topic/65810-close-browser-window-or-redirect-at-specific-time/#findComment-328964 Share on other sites More sharing options...
davelr45 Posted August 20, 2007 Author Share Posted August 20, 2007 This is kinda what I was thinking but I wanted to know if anyone had done it before. live video 1 goes from 9am to 10:55 am (these users must not be watching video after 11am) live video 2 goes from 11am to 12.55pm $currtime = current time()... $time_log_off = 11:00am... $diff = $currtime - $time_log_off... echo "<meta http-equiv=\"refresh\" content= \"$diff\;url=video_over.htm">"; Quote Link to comment https://forums.phpfreaks.com/topic/65810-close-browser-window-or-redirect-at-specific-time/#findComment-329018 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.