Ver Mensaje Individual
  #13 (permalink)  
Antiguo 21/06/2012, 13:59
isaacr_22
 
Fecha de Ingreso: noviembre-2011
Mensajes: 24
Antigüedad: 13 años, 2 meses
Puntos: 0
Respuesta: no me muestra la información de quien subió la noticia

Cita:
Iniciado por Heiroon Ver Mensaje
Amigazo, en la linea 7 de la última porción de código que pusiste, hace llamada a una tal función conectar(). Seguramente la declaras en el archivo que en la linea 4 incluyes, llamado conecta.php.

Probablemente allí este el problema. Y ese es el código que necesitamos ver.

Código PHP:
Ver original
  1. <?php
  2. include("includes/conexion.php");
  3. include("conecta.php"); //<--- Este archivo!!!
  4. $id=$_GET['clave'];
  5. $sql="select * from tbl_noticias where id='$id'";
  6. $rs=conectar($sql);
  7. ?>
Hola amigo gracias por ayudar.

pues mira me parece a ver si es esto

Código PHP:
Ver original
  1. <?php
  2.     function Conectar($sql,$base="nombasededatos",$clave="pass",$usuario="nomus",$servidor="localhost" )
  3.         {
  4.         $conexion=mysql_connect($servidor,$usuario,$clave) or die(mysql_error());
  5.  
  6.         mysql_select_db($base,$conexion);
  7.  
  8.         $rs=mysql_query($sql,$conexion) or die (mysql_error()) ;
  9.  
  10.         return $rs;
  11.  
  12.         mysql_free_result($rs);
  13.     }
  14. ?>
  15. <?php
  16.  function lisbor($sec)
  17.  {
  18.     $sql="select * from tbl_l_clasi where opc_menu='$sec' order by fecha DESC";
  19.     $rs=conectar($sql);
  20.     $datos="<table width=200 border=1>
  21.          <tr>
  22.            <td>CLASIFICADO</td>
  23.            <td>FECHA</td>
  24.            <td>MODIFICAR</td>
  25.             <td>ELIMINAR</td>
  26.          </tr>";
  27.    while($f=mysql_fetch_array($rs))
  28.     {
  29.          $datos.="<tr>
  30.                     <td>$f[titulo]</td>
  31.                     <td>$f[fecha]</td>
  32.                     <td><a href=modiclasificado.php?clave=$f[0]>MODIFICAR</a></td>
  33.                     <td><a href=modi.php?t=3&clave=$f[0]>ELIMINAR</a></td>
  34.                 </tr>";
  35.     }
  36.     return $datos;
  37.  }
  38.  function busclasi($p)
  39.  {
  40.     $sql="select * from tbl_l_clasi where titulo like '%$p%' OR descripcion like '%$p%' order by fecha DESC";
  41.     $rs=conectar($sql);
  42.    
  43.    while($f=mysql_fetch_array($rs))
  44.    {
  45.  ?>  
  46.     <h2><a href="clas.php?clave=<?php echo $f[0]?>&i=4"><?php echo htmlentities($f['titulo'])?></a></h2><br />
  47.      
  48.       <div class="imagen_noticia"><?php if (empty($f['imagen'])){}else{?><img src="<?php echo $f['imagen']?>" alt="" width="209" height="186" /><?php }?> </div>
  49.       <p><strong><a href="clas.php?clave=<?php echo $f[0]?>&i=4""><?php echo htmlentities($f['descripcion'])?>...Leer mas</a></p><br /><br /><br />
  50.       <br /><br /><br /><br /><br /><br /><br /><br />
  51.      
  52.       </br>
  53. <?php
  54. }
  55.  echo "<br>";
  56.  }
  57. ?>
  58. <?php
  59.  function buscaeventos($m)
  60. {
  61.        $sql="select * from tbl_eventos where evento like '%$m%' or descripcion like '%$m%'";
  62.         $rs=conectar($sql);
  63.          while($f=mysql_fetch_array($rs))
  64.          {
  65.         ?>
  66.            <p><p /><br /><br />
  67.            <h2><a href="evento_interno.php?clave=<?php echo $f[0]?>&i=3"><?php echo "Evento ".$f[0]?></a></h2>
  68.            <div class="imagen_noticia"><?php if (empty($f['imagen'])){}else{?><img src="<?php echo $f['imagen']?>" width="209" height="186" /><?php }?> </div>
  69.               <p><strong><?php echo $f[1]?></strong></p>
  70.               <p><?php echo $f[2]?></p>
  71.               <br/>
  72.               <a href="#">Inicia: </a> <?php echo $f[3]?>
  73.                     <br/>
  74.               <a href="#">Finaliza: </a> <?php echo $f[4]?>
  75.                     <br/>
  76.               <a href="#">Horario: </a> <?php echo $f[5]?>
  77.                     <br/>
  78.               <a href="#">Lugar: </a><?php echo $f[6]?>
  79.                     <br/>
  80.               <a href="#">Costo: </a><?php echo $f[7]?>
  81.                           <br/>
  82.               <a href="<?php echo $f[8]?>">Web: <?php echo $f[8]?></a>
  83.               <?php  
  84.          }
  85. }  
  86. function buscanotas($n)
  87. {
  88.    $sql="select * from tbl_noticias where titulo like '%$n%' or descripcion like '%$n%'order by fecha DESC";
  89.    $rs=conectar($sql);
  90.    while($f=mysql_fetch_array($rs))
  91.    {
  92.  ?>  
  93.     <h2><a href="#"><?php echo $f['titulo']?></a></h2>
  94.      
  95.       <div class="imagen_noticia"><?php if (empty($f['contenido'])){}else{?><img src="<?php echo $f['contenido']?>" alt="" width="209" height="186" /><?php }?> </div>
  96.       <p><strong><a href="noticia_interno.php?clave=<?php echo $f['id']?>"><?php echo utf8_decode(busca($f['descripcion']))?>..Leer mas</a></strong></p>
  97. <?php
  98. }
  99. }    
  100. ?>