Foros del Web » Programando para Internet » PHP »

Ayuda con un libro de visitas q me funciona mal

Estas en el tema de Ayuda con un libro de visitas q me funciona mal en el foro de PHP en Foros del Web. Hola a todos aquí, bueno el error que tiene este libro de visitas que descargué y puse en mi página es que al comentar los ...
  #1 (permalink)  
Antiguo 13/04/2010, 01:17
 
Fecha de Ingreso: abril-2010
Mensajes: 3
Antigüedad: 14 años
Puntos: 0
Sonrisa Ayuda con un libro de visitas q me funciona mal

Hola a todos aquí, bueno el error que tiene este libro de visitas que descargué y puse en mi página es que al comentar los post quedan siempre dobles como si se enviaran dos veces, los post los escribes en el index, al presionar "enviar comentario" el "index.php" te pasa a la pagina "insertar.php" la cual escribe en un archivo txt los comentarios que se veran despues en index. pero en este archivo .txt los comentarios quedan dobles por lo cual obviamente en la pagina salen dobles.
Esto me lleva a tener que abrir el archivo.txt todos los dias para editar y borrar los comentarios sobrantes.

he rebisado una y otra vez los codigos pero mi poco conocimiento en Php no me permite reconocer el problema...

aki les dejo el libro de visitas Funcionando en su version recien descargado:

http://www.sealo.260mb.com

y aqui la versión q yo modifiqué para la pagina que lo necesito

http://www.adngenes.tk/ (esta version es diferente al codigo que puse aqui abajo, ya que modifique los fondos y los colores)
  #2 (permalink)  
Antiguo 13/04/2010, 01:22
 
Fecha de Ingreso: abril-2010
Mensajes: 3
Antigüedad: 14 años
Puntos: 0
Respuesta: Ayuda con un libro de visitas q me funciona mal

aquí estan los codigos.

Index.php

<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<meta http-equiv="Content-Language" content="es">
<META NAME="title" CONTENT="[:: wWw.VicioAlex.Com ::]">
<META Name="description" CONTENT="[:: wWw.VicioAlex.Com ::] - Llamadas Gratis | Imagenes Hi5 | Ringtones Gratis | Juegos Gratis | SMS Gratis | Trucos Msn | Trucos Spaces Live | Versos y Frases De Amor | Bromas Pc | Videos Graciosos | Trucos Celulares | Trucos Windows | Hosting Gratis | Dominios Gratis | Fuentes Pc | Plantillas Web | Themes Web | Codigos Html | Codigos Php & MySQL | Codigos Java Scripts | Animaciones..">
<META Name="keywords" CONTENT="[:: wWw.VicioAlex.Com ::] - Llamadas Gratis | Imagenes Hi5 | Ringtones Gratis | Juegos Gratis | SMS Gratis | Trucos Msn | Trucos Spaces Live | Versos y Frases De Amor | Bromas Pc | Videos Graciosos | Trucos Celulares | Trucos Windows | Hosting Gratis | Dominios Gratis | Fuentes Pc | Plantillas Web | Themes Web | Codigos Html | Codigos Php & MySQL | Codigos Java Scripts | Animaciones..">
<meta http-equiv="Reply-to" content="[email protected]">
<META HTTP-EQUIV="pragma" content="no-cache">
<META Name="revisit" CONTENT="15 days">
<META Name="robots" CONTENT="all">


<BODY leftMargin=0 topMargin=0 marginwidth="0" marginheight="0" body="">
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
<TBODY><TR><TD background=index_archivos/XD-Adromeda_TBL_03.gif><IMG height=30 alt="" src="img/m1.gif" width=53></TD>
<TD width="100%" background=img/a1.gif> </TD><TD><IMG height=30 alt="" src="img/m2.gif" width=38></TD></TR></TBODY></TABLE>
<TABLE height=26 cellSpacing=0 cellPadding=0 width="100%" align=center border=0><TBODY><TR>
<TD vAlign=top width=16 background=img/c1.gif><IMG height=1 alt="" src="img/c1.gif" width=16></TD><TD vAlign=top bgColor=#18181b>



<center><img src='img/comen.jpg' alt='Alexzhito' title='Alexzhito' /></center>
</br>

<span class="Estilo1">Espero sus comentarios amigos xD: </span></br></br>




<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%" valign="top" bgcolor="#18181b">
&nbsp;<center>
<table border="0" cellpadding="0" cellspacing="0" width="90%" height="43">
<tr>
<td width="100%" height="43"><fieldset><legend><span class="Estilo4">Mi Libro de Visitas..xD</span></legend>
<label>
<center>
<center><table cellpadding="0" cellspacing="0" width="90%" border="0"><tr><td width="100%">
<div align="center">
<form method="GET" action="insertar.php"><table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#000000">
<tr>
<td width="100%">
<div align="center">
<table border="1" cellpadding="2" cellspacing="0" width="100%" bordercolorlight="#FFFF00" bordercolordark="#FFFF00" style="border-collapse: collapse" bordercolor="#FFFF00">
<tr>
<td width="100%" colspan="2" bgcolor="#18181b">
<p align="center"><span class="Estilo4">
<font color="#FFFFFF">
<span style="font-size: 8pt">SALUDOS </span>
</font><span style="font-size: 8pt">
<span class="Estilo6"><font color="#FFFFFF">-</font></span><font color="#FFFFFF">
</font><span class="Estilo8">
<font color="#FFFFFF">ANUNCIOS</font></span><font color="#FFFFFF">
</font><span class="Estilo7">
<font color="#FFFFFF">- </font></span>
<font color="#FFFFFF">COMENTARIOS </font>
<span class="Estilo7"><font color="#FFFFFF">-
</font></span></span><span class="Estilo6">
<span style="font-size: 8pt">
<font color="#FFFFFF">SUGERENCIAS -</font></span><span class="Estilo9"><font color="#FFFFFF"><span style="font-size: 8pt">
FIRMAS </span></font></span></span></span></td>
</tr>



<tr>
<td width="34%" bgcolor="#18181b">
<p align="right">Tu nombre</td>
<center>
<center>
<center>
<center>
<td width="66%" bgcolor="#18181b">
<input type="text" name="nombre" size="20" style="font-family: 'Trebuchet MS', Arial; font-size: 8 pt; color: #000000; border: 1px solid #000000; "></td>
</tr>



<tr>
<td width="34%" bgcolor="#18181b">
<p align="right">Tu email</td>
<center>
<center>
<center>
<center>
<td width="66%" bgcolor="#18181b"><label>
<input type="text" name="email" size="20" style="font-family: 'Trebuchet MS', Arial; font-size: 8 pt; color: #000000; border: 1px solid #000000; "></label></td>
</tr>



<tr>
<td width="34%" bgcolor="#18181b">
<p align="right">Comentario</td>
<center>
<center>
<center>
<center>
<td width="66%" bgcolor="#18181b">
<textarea rows="7" name="comentario" cols="50" style="font-family: 'Trebuchet MS', arial; font-size: 8 pt; color: #000000; border: 1px solid #000000; "></textarea></td>
</tr>



<tr>
<td width="34%" bgcolor="#18181b">
<p align="right">Opinión sobre la web</td>
<center>
<center>
<center>
<center>

<td width="66%" bgcolor="#18181b">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="20%" align="center"><img border="0" src="mbuena.gif" width="15" height="15"><br>
<input type="radio" value="mbuena" checked name="opinion"></td>
<td width="20%" align="center"><img border="0" src="perfecta.gif" width="15" height="15"><br>
<label>
<input type="radio" value="perfecta" name="opinion"></label></td>
<td width="20%" align="center"><img border="0" src="buena.gif" width="15" height="15"><br>
<label><input type="radio" value="buena" name="opinion"></label></td>
<td width="20%" align="center"><img border="0" src="mala.gif" width="15" height="15"><br>
<label><input type="radio" value="mala" name="opinion"></label></td>
<td width="20%" align="center"><img border="0" src="mmala.gif" width="15" height="15"><br>
<label><input type="radio" value="mmala" name="opinion"></label></td>
</tr>
</table>
</div>
</td>
</tr>

<tr>
<td width="34%" bgcolor="#18181b">
<p align="right">Confirmar</td>
<td width="66%" bgcolor="#18181b">
<p align="left">
<input type="submit" value="E N V I A R" style="FONT-WEIGHT: bold; FONT-SIZE: 12px; BORDER-LEFT-COLOR: #facc04; BORDER-BOTTOM-COLOR: #facc04; COLOR: #facc04; BORDER-TOP-STYLE: solid; BORDER-TOP-COLOR: #facc04; FONT-FAMILY: Verdana; BORDER-RIGHT-STYLE: solid; BORDER-LEFT-STYLE: solid; BACKGROUND-COLOR: #000000; BORDER-RIGHT-COLOR: #facc04; BORDER-BOTTOM-STYLE: solid">
<label>
<input type="reset" value="B O R R A R" style="FONT-WEIGHT: bold; FONT-SIZE: 12px; BORDER-LEFT-COLOR: #facc04; BORDER-BOTTOM-COLOR: #facc04; COLOR: #facc04; BORDER-TOP-STYLE: solid; BORDER-TOP-COLOR: #facc04; FONT-FAMILY: Verdana; BORDER-RIGHT-STYLE: solid; BORDER-LEFT-STYLE: solid; BACKGROUND-COLOR: #000000; BORDER-RIGHT-COLOR: #facc04; BORDER-BOTTOM-STYLE: solid"></label></td>
</tr>
</table>
</div>
</td>
</tr>
</table><input type="hidden" name="fecha" value="<? echo(date("d/m/Y")); ?>"></form>
</div>
<p align=justify><? include("index.txt") ?></p>
</td></tr></table></label></fieldset>&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>

<br/>
</br>
</br>
<center>
<span class="Estilo2 Estilo10"><strong><a href="index.php">1 </a></strong></span>
</center>

<center><span class="Estilo2"><strong>[ <a href="javascript:history.go(-1)">Volver Atrás</a> ]</strong></span></center>

</br>

</TD><TD vAlign=top width=16 background=img/c2.gif>
<DIV align=right><IMG height=1 alt="" src="img/c2.gif" width=16></DIV></TD></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0><TBODY><TR>
<TD vAlign=top width=11><IMG height=33 alt="" src="img/m3.gif" width=45></TD><TD vAlign=top width="100%" background=img/a2.gif>
<DIV align=center></DIV></TD><TD vAlign=top width=19>
<DIV align=right><IMG height=33 alt="" src="img/m4.gif" width=50></DIV></TD></TR></TBODY></TABLE>
  #3 (permalink)  
Antiguo 13/04/2010, 01:23
 
Fecha de Ingreso: abril-2010
Mensajes: 3
Antigüedad: 14 años
Puntos: 0
Respuesta: Ayuda con un libro de visitas q me funciona mal

y aquí el otro

insertar.php

<META HTTP-EQUIV = 'Refresh' Content = '2; URL =index.php'>
</head>
<body topmargin="0" leftmargin="0">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%" valign="top" bgcolor="#18181b">
&nbsp;<center>
<table border="0" cellpadding="0" cellspacing="0" width="90%" height="43">
<tr>
<td width="100%" height="43"><fieldset><legend><b><font size="2">Libro
de visitas</font></b>
</legend>
<label>
<center>
<center><table cellpadding="0" cellspacing="0" width="90%" border="0"><tr><td width="100%"><p align=justify>
<?php

$fp=fopen("index.txt","r+");
$anterior=fread($fp,filesize("index.txt"));
rewind($fp);
$nuevo = "<b><font color=\"#000088\" size=\"2\">
<a href=mailto:$HTTP_GET_VARS[email]/ class=\"nombre\">$HTTP_GET_VARS[nombre]</a> <font color=\"#FFFFFF\">($HTTP_GET_VARS[fecha])</font></font></b>&nbsp;&nbsp;<img src=$HTTP_GET_VARS[opinion].gif border=0><br><p align=justify>$HTTP_GET_VARS[comentario]<hr>";
$total = $nuevo.$anterior;
if(fwrite($fp,$total)) {
Echo "Gracias, tu comentario ha sido insertado correctamente. <p align=center><a href=index.php>Volver</a>";
}Else{
Echo "Error, por alguna razón desconocida no ha sido procesado su comentario. Compruebe que ha rellenado todos los campos e inténtelo de nuevo.";
}
fclose($fp);
?>


<?php

$fp = fopen("ultimo.txt","w");
if(fwrite($fp, "Último comentario en el libro de visitas:<p align=justify>$HTTP_GET_VARS[comentario]<br><br><b>Enviado por <a href=\"mailto:$HTTP_GET_VARS[email]\">$HTTP_GET_VARS[nombre]</a></b><p align=right><b>
<a href=libro/index.php/ class=vol>Ver más</a></b>")){
Echo " ";
}Else{
Echo " ";
}
fclose($fp);
?></p>
</td></tr></table></label></fieldset>&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%" bgcolor="#18181b">
<p align="center">Gracias Por Visitar La Web y Sigue Entrando porq
cada vez estamos mas activados que nunca..!! </td>
</tr>
</table>
</center>
</div>

Etiquetas: Ninguno
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 10:00.