Hola!

Registrándote como bakuno podrás publicar, compartir y comunicarte en privado con otros bakuos :D

Regístrame ya!

otra ves ayuda con un foro

jesusjalpan

Bovino maduro
Desde
22 Nov 2008
Mensajes
129
hola amigos tengo un problema con un foro :
el problema es que al darle clic a un tema no me habre el tema y respuestas que deben ser sino otras cosas espero me puedan ayudar gracias... dejo mi codigo

code de pagina donde estan los temas para selecionar
<html>
<head>
<title>ForoTec</title>

</head>

<body bgcolor="#3399CC" text="#FFFFFF" link="#FFFFFF">
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td bgcolor="#333333"><h2>Foro Tec</h2>
<div align="right">[ <a href="inicio.html">Inicio</a> ][ <a href="formulario.html">Crear tema </a>]</div></td>
</tr>
</table>


<?php


$usuario=$_POST['usuario'];
$titulo=$_POST['titulo'];
$mensaje=$_POST['mensaje'];
$identificador=$_POST['identificador'];


$conexion =mysql_connect("127.0.0.1","root","") or die ("error en la conexion");

mysql_select_db("foro1",$conexion);

$consulta = mysql_query("SELECT * from foro where identificador = 0 ORDER BY fecha desc",$conexion);
$consulta = mysql_query('SELECT * FROM `foro` WHERE `identificador`=0 ORDER BY `fecha`');

$nfilas = mysql_num_rows ($consulta);
if ($nfilas > 0)
{

echo "<TABLE width='90%' border ='1' align='center'cellpadding='2' cellspacing='2' bgcolor='green'>\n";
echo"<TR> \n";
echo "<TD><b>Título</b></TD> \n";
echo "<TH><b>Mensaje</b></TH> \n";
echo "<TH><b>Usuario</b></TH> \n";
echo "<TH><b>Respuestas</b></TH> \n";
echo "<TH><b>Ultima Respuesta</b></TH> \n";
echo "</TR> \n";

for ($i=0; $i<$nfilas; $i++)
{
$resultado = mysql_fetch_array ($consulta);

echo "<TR> \n";
echo "<TD width='90' align='center'> <font size='2'><a href= respuestas_inform.php? identificador=$identificador>" . $resultado['titulo'] . "</TD></a>\n";
echo "<TD width='100' align='center'> <font size='2'>" . $resultado['mensaje'] . "</TD>\n";
echo "<TD width='100' align='center'> <font size='2'>" . $resultado['usuario'] . "</TD>\n";
echo "<TD width='100' align='center'> <font size='2'>" . $resultado['respuestas'] . "</TD>\n";
echo "<TD width='120' align='center'> <font size='2'>" . $resultado['ult_respuesta'] ."</TD>\n";


echo "</TR> \n";

}
echo "</TABLE> \n";
}
else
echo "No hay noticias disponibles";



mysql_close($conexion);


?>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="2" bgcolor="#4b557d">
<tr>
<td align="center">ForoTec Copyrigth SoftDev-Group</td>
</tr>
</table>
</body>
</html>

</html>


______________________________
code para tema selecionado y que muestre las respuestas dadas

<html>
<head>
<title>ForoTec</title>

</head>

<body bgcolor="#3399CC" text="#FFFFFF" link="#FFFFFF">
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td bgcolor="#333333"><h2>Foro Tec</h2>
<div align="right">[ <a href="inicio.html">Inicio</a> ][ <a href="formulario.html">Crear tema </a>]</div></td>
</tr>
</table>


<?php


$usuario=$_POST['usuario'];
$titulo=$_POST['titulo'];
$mensaje=$_POST['mensaje'];
$identificador=$_POST['identificador'];


$conexion =mysql_connect("127.0.0.1","root","") or die ("error en la conexion");

mysql_select_db("foro1",$conexion);

$consulta = mysql_query("SELECT * from foro WHERE id='$id' ORDER BY fecha DESC" ,$conexion);

while($row= mysql_fetch_array($consulta)){
$titulo=$row['titulo'];
$usuario=$row['usuario'];
$mensaje=$row['mensaje'];
$id=$row['id'];
$fecha=$row['fecha'];
$respuestas=$row['respuestas'];


echo "<TR> \n";
echo "<TD width='90' align='center'> <font size='2'><a href= 'formulario.html'>" . $resultado['titulo'] . "</TD></a>\n";
echo "<TD width='100' align='center'> <font size='2'>" . $resultado['mensaje'] . "</TD>\n";
echo "<TD width='100' align='center'> <font size='2'>" . $resultado['usuario'] . "</TD>\n";
echo "<TD width='100' align='center'> <font size='2'>" . $resultado['respuestas'] . "</TD>\n";
echo "<TD width='120' align='center'> <font size='2'>" . $resultado['ult_respuesta'] ."</TD>\n";
echo "<a href=agregar.php?id= $id&respuestas=$respuestas> ";
echo "<br><br>";
echo "añadir un mensaje</a>&nbps;";

echo "</TR> \n";


echo "</TABLE> \n";
}
$consulta2 = mysql_query("SELECT * FROM foro WHERE identificador= '$id'ORDER BY fecha DESC",$conexion);
echo "RESPUESTAS: <br><hr>";
while($row = mysql_fetch_array($consulta2)){
$titulo=$row['titulo'];
$usuario=$row['usuario'];
$mensaje=$row['mensaje'];
$id=$row['id'];
$fecha=$row['fecha'];
$respuestas=$row['respuestas'];

echo "<table><tr><td>TITULO: $titulo</td></tr>";
echo "<table><tr><td>AUTOR: $usuario</td></tr>";
echo "<table><tr><td>MENSAJE: $mensaje</td></tr>";
}

mysql_close($conexion);


?>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="2" bgcolor="#4b557d">
<tr>
<td align="center">ForoTec Copyrigth SoftDev-Group</td>
</tr>
</table>
</body>
</html>

</html>



porfa ayudenme .................................gracias..
 
Volver
Arriba