Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/05/2011, 12:08
Stylok
 
Fecha de Ingreso: mayo-2011
Mensajes: 4
Antigüedad: 13 años
Puntos: 0
Pregunta Validar qe ningun espacio esté vacio

Este es mi index
Código PHP:
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Sumar</title>
    </head>
    <body>
        <?php
echo "<h1>BIENVENIDO AL SISTEMA DE SUMA</H1>";

        
?>
        <form action="resultado.php" method="post">
            Nota 1: <input type="text" name="n1"><br>
            Nota 2: <input type="text" name="n2">
            <input type="submit">

        </form>
    </body>
</html>
resultado.php
Código PHP:
<?php
        
function validarCV(){
            
$resultado=$_POST["n1"]+$_POST["n2"];
            
$campo1=$_POST["n1"];
            
$campo2=$_POST["n2"];

            if ( ! empty(
$_POST)){
                if (
$campo1 == " " or $campo2 == " ") {
echo 
"Debes rellenar todos los campos";

}else {
echo 
"el resultado de la suma seria = $resultado";
            }
            }
        }
        
?>
**Destacar qe el código de resultado.php lo saque de un topic del foro.

Chicos cuando corro este proyecto php (no se como llamarlo) me sale la interfaz correcta y todo pero cuando envio la solicitud, no me muestra nada de nada de lo qe me gustaría qe se ejecutara en resultado.php

Eso, les agradecería mucho la ayuda Gracias