Ver Mensaje Individual
  #18 (permalink)  
Antiguo 11/08/2009, 05:21
esdesign
 
Fecha de Ingreso: agosto-2009
Ubicación: Lanzarote - Canarias
Mensajes: 57
Antigüedad: 14 años, 8 meses
Puntos: 2
Respuesta: Inserto un comentario y se pone en todas las noticias [ayuda]

Código PHP:
<?php 
            
require("conexion.php");
$noticia_id intval($_GET['codigo']);
$sql "SELECT * FROM mensaje WHERE codigo = $noticia_id";
$res mysql_query($sql) or die(mysql_error());
echo 
"<table width=600 border=0 align=center cellpadding=3 cellspacing=4 bgcolor=#000000>";
while(
$row mysql_fetch_array($res)){
  echo 
"<tr>";
    echo 
"<td><table width=100% border=0 cellspacing=3 cellpadding=2>";
      echo 
"<tr>";
        echo 
"<td><table width=100% border=0 cellspacing=2 cellpadding=1>";
          echo 
"<tr>";
            echo 
"<td><div class=Estilo8>".$row['titulo']."<div></td>";
          echo 
"</tr>";
          echo 
"<tr>";
            echo 
"<td><div class=Estilo10>Por ".$row['persona']." - ".$row['fecha']."<div></td>";
          echo 
"</tr>";
                    echo 
"<tr>";
            echo 
"<td height=5><div class=Estilo7><div></td>";
          echo 
"</tr>";
                    echo 
"<tr>";
            echo 
"<td><div class=Estilo7>".$row['fotonota']."<div></td>";
          echo 
"</tr>";
                    echo 
"<tr>";
            echo 
"<td height=5><div class=Estilo7><div></td>";
          echo 
"</tr>";
                    echo 
"<tr>";
            echo 
"<td><div class=Estilo7>".$row['mensa']."<div></td>";
          echo 
"</tr>";
        echo 
"</table></td>";
     echo  
"</tr>";
      echo 
"<tr>";
       echo  
"<td height=20 background=separador.png>&nbsp;</td>";
     echo  
"</tr>";
    echo 
"</table></td>";
  echo 
"</tr>";


}
echo 
"</table>";
            
$query=mysql_query("select * from comen where codigomensaje='$noticia_id' ",$connection);
            
$array=mysql_fetch_array($query);
            echo 
$array['mensaje'];
            
?>
            
            <form id="form1" name="form1" method="post" action="guardar.php">
              <label>
              <input type="text" name="nombre" id="nombre" />
              </label>
                                    <p>
                                      <label>
                                      <input name="codigomensaje" type="hidden" id="codigomensaje" value="<?php "$noticia_id" ?>" />
                                      </label>
                                    </p>
<p>
                                      <label>
                                      <textarea name="mensaje" id="mensaje" cols="45" rows="5"></textarea>
                                      </label>
                    </p>
                                    <p>
                                      <label>
                                      <input type="submit" name="button" id="button" value="Enviar" />
                                      </label>
                                    </p>
            </form>