Ver Mensaje Individual
  #2 (permalink)  
Antiguo 09/11/2011, 05:40
Avatar de Uncontroled_Duck
Uncontroled_Duck
Colaborador
 
Fecha de Ingreso: mayo-2011
Ubicación: Málaga [Spain]
Mensajes: 806
Antigüedad: 13 años
Puntos: 261
Respuesta: Sumar valores de un textbox y calcular , PHp

Estas enviando los imput con $a y $b. E intentas recogerlos con 'a' y 'b'

El form no necesita que lo imprimas dentro de php.
Puedes hacerlo así, y ves que trae POST
Código PHP:
<?php
$a 
= (int)$_POST['a'];
$b = (int)$_POST['b'];
var_dump($a$b);
?>

<html>
<head>
<title>Suma</title>
</head>
<body>
<form action="" method="POST">
dato1: <input type="text" name="a" value="" /></br>
dato2: <input type="text" name="b" value="" /></br>
<input type="Submit" name="sumar" value="SUMA" /></br>

<?php
$suma 
$a $b;
echo 
$suma
?>
__________________
Todos agradeceremos que pongas el código en su respectivo Highlight