Non ho capito il print.
Guarda ti ho scritto due righe due di codice giusto per farti un'idea.
Premsso che per funzionare devi avere un server per testarlo in locale.
In pratica non è altro che un form html che fa la somma di due numeri (in php) e prima chiede la conferma con la finestra confirm in javascript.

<html>
<head>
<title>Somma di due numeri</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="JavaScript">
function conferma()
{
var sicuro = confirm('Calcolare la somma?');
if (sicuro == true)
return true;
else
return false;
}

</script>
</head>

<body>
<form name="somma" method="post" action="<?php $PHP_SELF ?>" onSubmit="return conferma()">
<input type="text" name="valore1">

<input type="text" name="valore2">

<input type="submit" value="Calcola">
</form>
<?php
if (isset($_POST['valore1']) && isset($_POST['valore1']))
{
$valore1 = $_POST['valore1'];
$valore2 = $_POST['valore2'];
$somma = $valore1 + $valore2;
echo $somma;
}
?>
</body>
</html>