Codice PHP:
<html>
<head>
<title>Documento senza titolo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function somma(form) {
document.write "Sto eseguendo la funzione";
form.Somma.value=form.Add1.value() + form.Add2.value();
}
</script>
</head>

<body>
<form name="form" onClick="somma()">
Primo Addendo
<input type="text" name="Add1" value="0" maxlength="5"> 
 

Secondo Addendo
<input type="text" name="Add2" value="0" maxlength="5"> 
 

Totale
<input type="text" name="Somma" disabled value="0" maxlength="6">
<input type="submit" value="Somma">
</form>
</body>
</html>

se vuoi farlo in PHP..

<html>
<head>
<title>Documento senza titolo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php
  
if ($_REQUEST['id']) {
   
$num1 $_POST['Add1'];
   
$num2 $_POST['Add2'];
   echo 
"la somma di $num1 + $num2 = ".$num1 $num2;
  }
?>
</head>

<body>
<form name="form" method="post" action="pippo.php?id=1">
Primo Addendo
<input type="text" name="Add1" value="0" maxlength="5"> 
 

Secondo Addendo
<input type="text" name="Add2" value="0" maxlength="5"> 
 

Totale
<input type="text" name="Somma" disabled value="0" maxlength="6">
<input type="submit" value="Somma">
</form>
</body>
</html>