You have to submit the result of the confirm box, for example in a form:
client side html
<form name="myform" action="..your_url.." method="post">
<input type="hidden" name ="jsanswer">
</form>
client side javascript:
myform.jsanswer = confirm('are you sure');
myform.submit();
serverside php
check postvar for jsanswer...