Foros del Web » Programando para Internet » PHP »

Un tagboard, mi Tagboard

Estas en el tema de Un tagboard, mi Tagboard en el foro de PHP en Foros del Web. Hola!!! Hice un tag, pero no funciona... y como no sé mucho de PHP quería saber si me ayudaban a encontrar los errores. El código ...
  #1 (permalink)  
Antiguo 24/06/2008, 11:23
 
Fecha de Ingreso: febrero-2008
Mensajes: 58
Antigüedad: 16 años, 2 meses
Puntos: 0
Un tagboard, mi Tagboard

Hola!!!
Hice un tag, pero no funciona... y como no sé mucho de PHP quería saber si me ayudaban a encontrar los errores.
El código para mostrar los mensajes que se llama comentarios.php es:
Código PHP:
<style>
.gris {
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 14px;
    font-style: normal;
    color: #CCCCCC;
    background-color: #666666;
}
.gris A:link {
    COLOR: #999999; TEXT-DECORATION: none
}
.gris A:hover {
    COLOR: #999999; TEXT-DECORATION: none}
.gris A:active {
    COLOR: #CCCCCC; TEXT-DECORATION: none
}
.dark {
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 18px;
    font-style: normal;
    color: #CCCCCC;
}
.dark A:link {
    COLOR: #666666; TEXT-DECORATION: none
}
.dark A:hover {
    COLOR: #999999; TEXT-DECORATION: none}
.dark A:active {
    COLOR: #999999; TEXT-DECORATION: none
}
</style>
<?   
include ("./config.php");   

$class1 "gris";
$class2 "dark";

$sql "SELECT * FROM tagboard ORDER BY 'id' DESC LIMIT 0, 20";   
    
$countx 0;
$resp mysql_query ($sql);   
while (
$tag mysql_fetch_array ($resp)) {   
    
$countx++;
?> <div class="<? if ($countx == ) {echo($class1);}
    else
    {echo(
$class2);
    
$countx 0;
    }
    
?>"><font alt="Este mensaje fue escrito hace <? echo hace_cuanto(.tag[fecha].); ?>" face=Georgia size=2>[<? .$tag[autor]. ?>]<? .$tag[comentario]. ?></font>   
<? }   
?></div>
Luego, el que muestra los mensajes y tiene un formulario para enviar mensajes:
Código PHP:
                 <SCRIPT>
        function 
send() {
            
document.getElementById("msm").value document.getElementById("sms").value;
            
document.getElementById("sms").disabled true;
            
document.getElementById("due").disabled true;
            
document.getElementById("qot").submit();
        }
        function 
actualizar() {
            
document.getElementById("wef").src "magic/tagboard/tagboard.php";
            
document.getElementById("sqor").innerHTML "Cargando...";
        }
      
</SCRIPT>
                   
                  <TABLE class=tag height=289 cellSpacing=0 cellPadding=0 width=410 align=center border=0>
                    <TBODY><TR>
                    <TD width="410" height=15 align=center>| <A onclick="actualizar(); return false;" href="#">Actualizar</A> | </TD>
                  </TR>
                    <TR>
                      <TD height=227>
                      <DIV 
                        style="OVERFLOW: auto; WIDTH: 100%; HEIGHT: 100%; TEXT-ALIGN: left"><SPAN 
                        id=tagboard></SPAN></DIV></TD></TR>
                    <TR>
                      <TD align=center><INPUT id=sms style="WIDTH: 300px" disabled maxLength=200 name=sms> <INPUT id=due disabled onclick=send(); type=button value=Envía name=due><BR>
                        <SPAN id=sqor style="FONT-SIZE: 10px; COLOR: #ffff00"></SPAN> 
        </TR></TBODY></TABLE>
                  <FORM id=cot name=cot action=magic/tagboard/enviar.php method=post target=wef><INPUT id=msm type=hidden name=msm> <INPUT type=hidden value=enviar name=accion> 
                  </FORM><IFRAME id=wef style="DISPLAY: none" name=wef 
                  src="magic/tagboard/tagboard.php"></IFRAME> 
Por último, el que envía a la Base de Datos el mensaje (se llama enviar.php) es:
Código PHP:
<?php   
include ("./config.php");   
if (
$comentario && $comentarios == "") {   
?><script>alert("Por favor, introduce un comentario");</script>   
<? }
elseif (
$comentario) {   
$comentarios htmlentities ($comentarios);   

$autor $_COOKIE[nick]
$comentarios $_POST[sms]
$fecha time();

mysql_query ("INSERT INTO tagboard (autor,comentario,fecha) VALUES ('$autor','$comentarios','$fecha')");   
  
}  
?>
Saludos y espero que me puedan ayudar.
  #2 (permalink)  
Antiguo 24/06/2008, 12:38
Avatar de david_M_G  
Fecha de Ingreso: febrero-2005
Mensajes: 938
Antigüedad: 19 años, 2 meses
Puntos: 20
Respuesta: Un tagboard, mi Tagboard

Cita:
$autor = $_COOKIE[nick]
$comentarios = $_POST[sms]
Código PHP:
$autor $_COOKIE['nick'];
$comentarios $_POST['sms']; 
Si sigue sin funcionarte, deberías especificar qué errores te aparecen...

Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:35.