Hola
sagatxxx. Bienvenido al foro.
A ver si te sirve esto:
Código PHP:
<html>
<head>
<script type="text/javascript">
var sum1; var sum2;
function ini() {
sum1 = Math.floor(Math.random()*10);
sum2 = Math.floor(Math.random()*10);
document.getElementById('s1').innerHTML = sum1;
document.getElementById('s2').innerHTML = sum2;
}
</script>
</head>
<body onload="ini()">
<form onsubmit="return total.value==sum1+sum2" />
<input type="text" />
<p>Suma <span id="s1"></span> + <span id="s2"></span>: <input type="text" name="total" /></p>
<input type="submit" />
</form>
</body>
</html>
Saludos,