Ver Mensaje Individual
  #4 (permalink)  
Antiguo 21/07/2005, 18:23
Goku00_1
 
Fecha de Ingreso: noviembre-2004
Mensajes: 68
Antigüedad: 19 años, 5 meses
Puntos: 0
<?
session_start();
if ($envianoticia) {
include('config.php');
include('bbcode.php');
$time = time(); //establecemos el tiempo actual para la fecha
$noticia = bbcode($noticia);
$origen = bbcode($origen);
$autor = $_SESSION['usuario'];
$idautor = $_SESSION['idusuario'];
$query = "insert into noticias (idautor, fecha, autor, titulo, noticia,origen) values ('$idautor', '$time', '$autor', '$titulo', '$noticia', '$origen')";
mysql_query($query); //insertamos el dato
echo "AÑADIDA<br><br>"; //te dice que se ha añadido
}
?>



<?
session_start();
include('config.php');
include('bbcode.php');
$query = "select * from noticias where id='$id'";
$resp = mysql_query($query);
while ($datos = mysql_fetch_array($resp)) {
$fecha = date("d/m/Y",$datos[fecha]);
$texto = codigo(nl2br($datos[noticia]));
$extraido = bbcode($datos[origen]);
echo '
<table width=400>
<tr><td><b>'.$datos[titulo].'</b></td><td align="right"><b>'.$fecha.'</b></td></tr>
<tr><td colspan=2>'.$texto.'</td></tr>
<tr><td><b>Origen: </b>'.$extraido.'</td><td align="right"><i>Enviada por <a href=perfil.php?id='.$datos[idautor].'><b>'.$datos[autor].'</b></a></i></td></tr>
</table><br>';
}
mysql_query($query);
?>