<form > <div class="form-group"> <label for="s1">Sumando 1:</label> <input type="text" class="form-control" name="s1" > </div> <div class="form-group"> <label for="s2">Sumando 2:</label> <input type="number" class="form-control" name="s2" required=""> </div> <input type="submit" value="Manda los datos"> </form> <?php $s1= filter_input(INPUT_GET,'s1',FILTER_VALIDATE_INT); $s2= filter_input(INPUT_GET,'s2',FILTER_VALIDATE_INT); echo "La suma es: ".($s1+$s2);