A lot of what you're talking about is client-side scripting as well, such as using Javascript's "onclose" handler in conjunction with an alert() box and window.open or something similar to execute a PHP script.
As the name suggests, PHPBuilder is a community that supports PHP. If you attempt the server-side part of the script and run into trouble, you should definitely do as Rodney said and post your code snippet that you tried and we'll help you out where you erred.
As to the client-side part (requiring Javascript, etc.), there is a ClientSide Technologies forum that can possibly help you with any questions.