Jump to content

checking if popup gets closed


AV1611

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.