Hi 🙂
Im newbie to this forum.
I have a PHP forum script,but I cant type into the new message or respond box with Netscape 6.0 or 7.0.
http://www.uesabadell.org/forum/index.php
it works properly with IE.
The message box is a iframe.
Anyone can help me? what can i do?
thanks 🙂
This the PHP code;
<?
include"header.php";
echo"<br><br><br>";
function parser($cadena){
global $conexion,$prefijo;
$result=mysql_query("SELECT * FROM ".$prefijo."malas_palabras",$conexion);
while($row=mysql_fetch_row($result)){
$cadena = ereg_replace("$row[1]","$row[2]",$cadena);
}
$cadena = ereg_replace("'", "''", $cadena);
return $cadena;
}
if (!isset($que)){
echo"<center>Como llegaste hasta aqui?</center>";
include"footer.php";
die;
}
if ($que=='guardar'){
if ($mensaje=='<FONT face=verdana size=-1></FONT>' || $nombre=='' || $titulo==''){echo"<br><br><br><center>".CREARERROR1."<br><br><br><br><input class=\"clsButton\" type=\"button\" value=\"Volver\" OnClick=\"javascript:history.back()\"></center>"; }
else{
$mensaje=parser($mensaje);
$titulo=parser($titulo);
$nombre=parser($nombre);
if(!isset($papi)){$papi=0;}
$result = mysql_query("SELECT anonimos FROM ".$prefijo."foros where id='$fid'",$conexion);
$row = mysql_fetch_row($result);
if(!isset($fpusuario) && $row[0]==0){echo"<br><br><center>".CREARMSG2."<br><br><br><br><a href=\"index.php?fid=$fid\"><img src=\"img/$lenguaje/aceptar.gif\" border=0 align=absmiddle></a></center>";}
else{$result = mysql_query("INSERT INTO ".$prefijo."_mensajes (id,f_id,autor,mensaje,fecha,padre,titulo) VALUES ('', '$fid','$nombre','$mensaje',NOW(),'$papi','$titulo') ",$conexion);
/*********************************************************/
/* codigo añadido para el tema de mensajes nuevos ********/
/*********************************************************/
$result2 = mysql_query("SELECT nick FROM ".$prefijo."_usuarios ",$conexion);
while ($row = mysql_fetch_row($result2) ) {
if ($row[0] != $nombre){
if ($papi != 0) {
$result = mysql_query("INSERT INTO ".$prefijo."_mensajes_nuevos (id_mensaje, usuario) VALUES ('$papi', '$row[0]') ",$conexion);
} else {
$result = mysql_query("INSERT INTO ".$prefijo."_foros_nuevos (id_foro, usuario) VALUES ('$fid', '$row[0]')", $conexion);
}
}
}
/*********************************************************/
echo"<br><br><center><b>";
if($papi==0)echo""._TOPICO."";
else echo""._MENSAJE."";
echo" "._CREADO."!</b><br><br><br><input class=\"clsButton2\" type=\"button\" value=\"Aceptar\" OnClick=\"javascript:location='$retorno_url'\"></center>";
}
}
}
if ($que=='topico' || $que=='mensaje'){
$result = mysql_query("SELECT anonimos,abierto FROM ".$prefijo."foros where id='$fid'",$conexion);
$row = mysql_fetch_row($result);
if($row[1]==0){echo"<br><br><center>".INDEXMSG3."</center><br><br><br>"; include"footer.php"; exit();}
if(!isset($fpusuario) && $row[0]==0)echo"<br><br><center>".CREARMSG2."<br><br><br><br><a href=\"javascript:history.back()\"><img src=\"img/$lenguaje/aceptar.gif\" border=0 align=absmiddle></a></center>";
else{
echo"
<script language=\"JavaScript\">
<!-- Hide from older browsers...
function FormatText(command, option){
frames.mensaje.document.execCommand(command, true, option);
frames.mensaje.focus();
}
// -->
</script>
<table width=500 cellspacing=1 cellpadding=2 align=center bgcolor=#CCCCCC>
<tr>
<td bgcolor=FFFFFF><center><b>";
if ($que=='topico'){echo"".CREARTOPICO.""; $retorno_url="index.php?fid=$fid";}
elseif($que=='mensaje'){echo"".CREARMENSAJE.""; $retorno_url="index.php?fid=$fid&up=$padre";}
echo"</b></center></td></tr>
<tr>
<td bgcolor=EEEEEE>
<form name=\"crear\" method=\"post\" action=\"crear.php?que=guardar\">
<input type=\"hidden\" name=\"retorno_url\" value=\"$retorno_url\">
<table width=\"300\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\">
<tr><td colspan=2>".CREARMSG1."<br><br></td></tr>
<tr>
<td align=\"left\" valign=\"middle\">".NOMBRE.":</td>
<td>";
if(isset($fpusuario)){
echo"$infocookie[0]";
}
else echo"".ANONIMO."";
echo"</td>
</tr>";
if ($que=='topico')echo"
<tr>
<td align=\"left\" valign=\"middle\"><b>"._TITULO.":</b></td>
<td>
<input class=\"clsTextbox\" type=\"text\" name=\"titulo\">
</td>
</tr>";
echo"<tr>
<td align=\"left\" valign=\"top\"><b>"._MENSAJE.":</b></td>
<td>
<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td>
<img src=\"img/post_button_cut.gif\" width=\"25\" height=\"24\" align=\"absmiddle\" OnClick=\"FormatText('cut')\" style=\"cursor: hand;\" alt=\"Cortar\">
<img src=\"img/post_button_copy.gif\" width=\"25\" height=\"24\" align=\"absmiddle\" OnClick=\"FormatText('copy')\" style=\"cursor: hand;\" alt=\"Copiar\">
<img src=\"img/post_button_paste.gif\" width=\"25\" height=\"24\" align=\"absmiddle\" OnClick=\"FormatText('paste')\" style=\"cursor: hand;\" alt=\"Pegar\">
<img src=\"img/post_button_bold.gif\" width=\"25\" height=\"24\" align=\"absmiddle\" alt=\"Negrita\" OnClick=\"FormatText('bold', '')\" style=\"cursor: hand;\">
<img src=\"img/post_button_italic.gif\" width=\"25\" height=\"24\" align=\"absmiddle\" alt=\"Cursiva\" OnClick=\"FormatText('italic', '')\" style=\"cursor: hand;\">
<img src=\"img/post_button_underline.gif\" width=\"25\" height=\"24\" align=\"absmiddle\" alt=\"Subrayado\" OnClick=\"FormatText('underline', '')\" style=\"cursor: hand;\">
<img src=\"img/post_button_left_just.gif\" width=\"25\" height=\"24\" align=\"absmiddle\" OnClick=\"FormatText('JustifyLeft', '')\" style=\"cursor: hand;\" alt=\"Alinear a la izquierda\">
<img src=\"img/post_button_centre.gif\" width=\"25\" height=\"24\" align=\"absmiddle\" border=\"0\" alt=\"Centrar\" OnClick=\"FormatText('JustifyCenter', '')\" style=\"cursor: hand;\">
<img src=\"img/post_button_right_just.gif\" width=\"25\" height=\"24\" align=\"absmiddle\" OnClick=\"FormatText('JustifyRight', '')\" style=\"cursor: hand;\" alt=\"Alinear a la derecha\">
<img src=\"img/post_button_list.gif\" width=\"25\" height=\"24\" align=\"absmiddle\" border=\"0\" alt=\"Lista\" OnClick=\"FormatText('InsertUnorderedList', '')\" style=\"cursor: hand;\">
<img src=\"img/post_button_outdent.gif\" width=\"25\" height=\"24\" align=\"absmiddle\" OnClick=\"FormatText('Outdent', '')\" style=\"cursor: hand;\" alt=\"Reducir sangrÃa\">
<img src=\"img/post_button_indent.gif\" width=\"25\" height=\"24\" align=\"absmiddle\" border=\"0\" alt=\"Aumentar sangrÃa\" OnClick=\"FormatText('indent', '')\" style=\"cursor: hand;\">
<img src=\"img/post_button_hyperlink.gif\" width=\"25\" height=\"24\" align=\"absmiddle\" border=\"0\" alt=\"Crear hipervÃnculo\" OnClick=\"FormatText('createLink')\" style=\"cursor: hand;\">
</td>
</tr>
</table>
<iframe class=\"texto\" src=\"blank.html\" id=\"mensaje\"></iframe>
<script language=\"javascript\">
frames.mensaje.document.designMode = \"On\";
</script>
<br>
<input type=\"hidden\" name=\"mensaje\" value=\"\">
</td>
</tr>
<tr>
<td align=\"left\" valign=\"top\"> </td>
<td align=\"right\">
<input class=\"clsButton\" type=\"button\" value=\"Cancelar\" OnClick=\"javascript:history.back()\">
<input type=\"submit\" value=\"Aceptar\" class=\"clsButton2\" name=\"Aceptar\" OnClick=\"document.crear.mensaje.value = frames.mensaje.document.body.innerHTML;\" tabindex=\"30\">
<input type=\"hidden\" name=\"fid\" value=\"$fid\">";
if(isset($fpusuario))echo" <input type=\"hidden\" name=\"nombre\" value=\"$infocookie[0]\">";
else echo"<input type=\"hidden\" name=\"nombre\" value=\"anonimo\">";
if ($que=='mensaje')echo"<input type=\"hidden\" name=\"titulo\" value=\"mensaje comun\">";
if(isset($padre))echo"<input type=\"hidden\" name=\"papi\" value=\"$padre\">";
echo"</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
";}
}
include"footer.php";
?>