miércoles, 5 de enero de 2022

Solución PHP 4.2

 <!DOCTYPE html>

<html>

<head>

</head>

<body>

<form action="index1.php" method="POST">

<?php 

for ($i=0; $i<10; $i++) {

    echo '<input type="text" name="nota'.$i.'"><br>';

}

?>

<input type="submit">

</form>

</body>

</html>


----------------------------------------------------------------------------


<?php

var_dump($_POST);

foreach ($_POST as $var) {

    $suma=$suma+$var;

}

echo "La suma total de los valores es: " . $suma;

?>

No hay comentarios:

Publicar un comentario