As was noted in one of the above comments, php is server side - it finishes all of its work before it ever gets to the user. I understand a possible need for a server-side popup in that the content may need to be customized on-the-fly with server content.
You'll need something on the client side to respond to a user (a client).
One way I do this is to create an empty <div> in the center of the screen. It has no content and is completely transparent in all ways. Inside of it you can create any type of HTML you wish. This is done with
AJAX [
^] (and thus requires javaScript). You create a visible box by changing the invisible boxes' content [via innerHTML]. Buttons (or anything else) can be part of that content. If you wish the buttons to interact with the user, have that interaction already existing on you page (it's hard to do, otherwise) and have you events call it. It is even possible to include javaScript in your AJAX update - a b it more skill required to execute it. You can make the box go away in your script by changing its contents (innerHTML) to nothing.
That all being said, if you're already using javaScript on the client side, unless the data only exists on the server, you don't want' to php it - you want to javascript it.
If this or any of the other replies solves your problem, please use it to mark the question closed.