AV1611 Posted July 26, 2009 Share Posted July 26, 2009 I'm starting here because I believe this is a PHP question but maybe not? ok, when you start index.php, as popup page opens, called page2.php. The popup plays music via a flashplayer... not important. So, I need a way to monitor from index.php if the popup is still open or if they closed it. I gather that sessions cannot be shared between the popup and the main page. So, is there a way? Quote Link to comment https://forums.phpfreaks.com/topic/167474-checking-if-popup-gets-closed/ Share on other sites More sharing options...
jayjay960 Posted July 26, 2009 Share Posted July 26, 2009 If you were to control your sessions through one page, then include that page wherever you need to use sessions, they would work. Quote Link to comment https://forums.phpfreaks.com/topic/167474-checking-if-popup-gets-closed/#findComment-883087 Share on other sites More sharing options...
Zyx Posted July 26, 2009 Share Posted July 26, 2009 PHP is a server-side technology, whereas Flash, JavaScript are client-side. PHP generates the HTML code that causes the flashplayers etc. to appear in the user browser, so when they become active, PHP script is not executed anymore. This also applies to your situation: your index.php file cannot control the execution of the flashplayer in pop-up in real time, because it was closed already closed once it generated the HTML code and sent it to the browser. You can notify the server on closing pop-ups with AJAX, but this will create a new HTTP request and a new PHP script to be executed that will generate the answer. Fortunately, it will see the session created by the first script. Quote Link to comment https://forums.phpfreaks.com/topic/167474-checking-if-popup-gets-closed/#findComment-883088 Share on other sites More sharing options...
AV1611 Posted July 26, 2009 Author Share Posted July 26, 2009 Thank you for your replies. As I don't know anything about JS or Ajax, I don't think I can go further unless someone gives me more help... Am I correct that if I set a session variable in the popup script (popup.php) that I cannot read that variable from index.php because it's a different browser instance? Quote Link to comment https://forums.phpfreaks.com/topic/167474-checking-if-popup-gets-closed/#findComment-883324 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.