Ver Mensaje Individual
  #4 (permalink)  
Antiguo 08/05/2009, 06:25
Avatar de gjx2
gjx2
 
Fecha de Ingreso: agosto-2008
Ubicación: R.D
Mensajes: 1.153
Antigüedad: 15 años, 8 meses
Puntos: 139
Respuesta: no me imprime nada en el formulario

Yo veo un pequeno problema.


Código PHP:

if (isset($_POST["intro"])) { 
$intro $_POST["intro"]; 

     if(
$intro==NULL)  
    { 
        echo 
"No hay informacion."
     
      } 
Estas linea dice que si el post["intro"] esta definido entonces la variable $intro=$_POST["intro"];

pero entonces dentro de esa misma condicion dices que si if($intro==NULL) .

O sea se supone que si el post no esta definido intro nunca sera evaluada o sea esta linea no se cumplen

Código PHP:
if($intro==NULL)  
    { 
        echo 
"No hay informacion."
     
      } 
verifica el codigo nuevamente .

Esta seria mi propuesta

Código PHP:
session_start();
$_SESSION['anio']=10;


$intro $_POST["intro"];

     if(
$intro==NULL)  
    { 
        echo 
"No hay informacion."
     
      }else{ 
     
$query 'SELECT desc FROM intro WHERE anio=\''.$_SESSION['anio'].'\'';//;  
         
echo $query;        
     
$checkanio_consulta mysql_query('SELECT desc FROM intro WHERE anio=\''.$_SESSION['anio'].'\''); 
           
           
           
           
            
$anio_consultas_exist mysql_num_rows($checkanio_consulta); 
                        
            if (
$anio_consultas_exist>0) { 
            echo 
"<p> NO SE PUDO INSERTAR, YA EXISTE UNA DEL AÑO    "$anio,"   POR FAVOR VERIFICA"
            
$tabla1mysql_query($query) or die(mysql_error()); 
            
$fila mysql_fetch_assoc($tabla1); 
             
       
      }else{ 
       
     
$query "INSERT INTO intro (anio, desc) 
               VALUES ('$anio', '$intro')"

                 
            
mysql_query($query) or die(mysql_error()); 
             
            echo 
'<p>HA SIDO REGISTRADA DE FORMA SATISFACTORIA.<br />'
            }     
         
        }