elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Sigue las noticias más importantes de seguridad informática en el Twitter! de elhacker.NET


  Mostrar Mensajes
Páginas: [1]
1  Programación / PHP / ayuda calculadora en php y html mira mi codigo gracias en: 17 Febrero 2013, 05:09 am
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>calculadora</title>
</head>

<body>
<form id="form1" name="form1" method="post" action="">
  <table width="218" border="1">
    <tr>
      <th width="97" scope="row">numero_1</th>
      <td width="105"><p>
        <label for="cmdNum1"></label>
        <input type="text" name="cmdNum1" id="cmdNum1" />
      </p></td>
    </tr>
    <tr>
      <th scope="row">numero_2</th>
      <td><label for="cmdNum2"></label>
      <input type="text" name="cmdNum2" id="cmdNum2" /></td>
    </tr>
    <tr>
      <th scope="row">&nbsp;</th>
      <td><input name="cmdSuma" type="submit" id="cmdSuma" value="sumar" />
        <input name="-resta" type="submit" id="cmdResta2" value="-" /><input name="cmdResta" type="submit" id="cmdResta" value="-" />
      <input name="cmddivide" type="submit" id="cmdDivide" value="-" /></td>
    </tr>
  </table>
  <?

$cmdNum1=$_post["cmdNum1"];
$cmdNum2=$_post["cmdNum2"];
$sumar=$_post["cmdSuma"];


    $suma= $cmdNum1+$cmdNum2;

 echo "la suma es : =$suma"  ;
 
 
?>

</form>
</body>
</html>
2  Programación / PHP / Re: Calculadora en Html y Php en: 17 Febrero 2013, 02:50 am


BUENAS TARDES  MIRA TENGO EL SIGUIENTE CODIGO CREADO PARA LA CALCULADORA Y ME PERMITE INGRESAR LOS NUMEROS PERO NO ME MUESTRA EL RESULTADO ME PODRIAS AYUDAR GRACIAS
<html>
<head>
<title>calculadora</title>
</head>

<body>
<form id="form1" name="form1" method="post" action="">
  <table width="218" border="1">
    <tr>
      <th width="97" scope="row">numero_1</th>
      <td width="105"><p>
        <label for="num_1"></label>
        <input type="text" name="num_1" id="num_1" />
      </p></td>
    </tr>
    <tr>
      <th scope="row">numero_2</th>
      <td><label for="num_2"></label>
      <input type="text" name="num_2" id="num_2" /></td>
    </tr>
    <tr>
      <th scope="row"><input name="sumar" type="submit" id="sumar" value="+" />
      <input name="-" type="submit" id="cmdResta" value="-" /></th>
      <td><input name="/" type="submit" id="cmdDivide" value="/" />
      <input name="*" type="submit" id="cmdMultiplica" value="*" /></td>
    </tr>
  </table>
  <?
$cmdSuma=$_post["cmdSuma"];
$cmdResta=$_post["cmdResta"];
$cmdmult=$_post["cmdmult"];
$cmddivde=$_post["cmdDivide"];
$num_1=$_post["num_1"];
$num_2=$_post["num_2"];

$sumar = $num_1+$num_2;

 if ($cmdSuma){
 echo "la suma es:";$Sumar;
 }
 
 
?>

</form>
</body>
</html>
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines