Ver Mensaje Individual
  #4 (permalink)  
Antiguo 18/12/2009, 10:01
Avatar de SirDuque
SirDuque
 
Fecha de Ingreso: febrero-2009
Ubicación: Paso del Rey, Buenos Aires, Argentina
Mensajes: 975
Antigüedad: 16 años
Puntos: 89
Respuesta: Perder variable al pasar por 3 formularios

SOLUCIONADO:

addforo.php
Código PHP:
<?
    $id
$_POST['id'];
    
$autor$_POST['autor'];
    
$titulo$_POST['titulo'];
    
$mensaje$_POST['mensaje'];
    
$respuestas$_POST['respuestas'];
    
$indentificar$_POST['indentificador'];
    
$host="127.0.0.1";
    
$user="root";
    
$password="a32wt251";
    
$db="foro";
    
$connect=mysql_connect($host,$user,$password);
    
mysql_select_db("foro",$connect);
    
$fecha=time();
    if(
$indentificador==0)
        {
$indentificador=$id;}
    
$respuesta=$respuestas+1;    
    
$sql="insert into foro1 (autor,titulo,mensaje,fecha,indentificador) values ('$autor', '$titulo','$mensaje','$fecha','$indentificador')";
    
mysql_query($sql);
    
$sql2="update foro1 set respuestas='$respuesta' where id='$indentificador'";
    
mysql_query($sql2);
    
$resultado=mysql_query("select '$mensaje' from foro1 where mensaje='$mensaje'",$connect);
    while (
$registro=mysql_fetch_row($resultado))
        { 
            echo 
"<tr>";
            foreach(
$registro as $clave)
                {
                    echo
"<td>",$clave,"</td>";
                }
        }
    echo
"<br><br>";
    echo
"<a href=indexforo.php>Volver al foro</a> </font></center>";
    
?>