He realizado una calculadora. Cuando hago las operaciones y le digo enviar sale una ventana que dice"el resultado es".
No me da el resultado de la operacion que hice.
Esto es lo que hice:
gracias por la ayuda
<html>
<form action='calculadora.php' method='post'>
<P> NUMERO A ELEGIR?<P>
numero1: <input type='text' name='operando1'size= '10' maxlength= '10'>
<br>
<P> OPERACION A REALIZAR</p>
<select size='10' name ='operador'>
<option value= '+' > + </option>
<option value= '-' > - </option>
<option value= '*' > * </option>
<option value= '/' > / </option>
</select>
<br>
<P> NUMERO A ELEGIR?<P>
numero2: <input type='text' name='operando2' size= '10' maxlength='10'>
<br> <BR>
<INPUT TYPE="SUBMIT" VALUE="ENVIAR RESULT" NAME="Enviar">
<br><br>
</form>
<?php
if (isset($_POST['+']))
{
$resultado=$_POST['operando1']+$_POST['operando2'];
}
if (isset($_POST['-']))
{
$resultado=$_POST['operando1']-$_POST['operando2'];
}
if (isset($_POST['*']))
{
$resultado=($_POST['operando1'])*($_POST['operando2']);
}
if (isset($_POST['/']))
{
$resultado=($_POST['operando1'])/($_POST['operando2']);
}
echo "El resultado es".$resultado;
?>
</body>
</html>