I'm assuming you are using PHP as a html parser and not as a CLI (Command Line Interface). As a HTML parser, PHP executes at the server side and the client is usually somewhere totally different. There's no interactivity between the server and the client at all. To offer some interactivity, you will have to dive in to the dark arts of Javascripting.
Paste the following and see what I mean.
<script>
var bConfirm = confirm("Let's do Javascript then");
if (bConfirm)
{
document.location="http://www.google.com/search?q=javascript";
}
</script>