Ver Mensaje Individual
  #7 (permalink)  
Antiguo 28/04/2009, 07:33
kaquna
 
Fecha de Ingreso: agosto-2007
Mensajes: 130
Antigüedad: 17 años, 6 meses
Puntos: 0
Respuesta: codigo coloreado

ufff

sigo perdida...

ya tengo modificado el fichero para que envez de un text area, me aparezca un rich text...

me funciona bien y todo, el unico problema es que el texto que tengo que cargar en el rich text esta cargado con php y esta en una variable. coloco esa variable como hacia con el text area pero no me funciona. ¿donde tengo el error?

milchisimas gracias

(he probado de estas maneras, que son las que, desde mi ignoracia, me parecen logicas...
Código:
<?
$fichero = $_GET["fichero"];
$textoFinal = $_POST["texto"];
if($textoFinal != ''){
   if($fp = @fopen($fichero,"w+")){
      @fwrite($fp,stripslashes($textoFinal));
      echo 'Archivo modificado<br><br>';
   }
   @fclose($fp);
}
$fp = @fopen($fichero,"r");
$contenido = @fread ($fp, filesize ($fichero));
@fclose($fp);?>

<table width='100%' border='0'>
  <tr>
    <td width='10%'>&nbsp;</td>
    <td width='80%' align='center'><br><h3>Modificar noticias</h3></td>
    <td width='10%'>&nbsp;</td>
  </tr>
  <tr>
    <td width='10%'>&nbsp;</td>
    <td width='80%' align='center'>
<form method="post">
<script language="JavaScript" type="text/javascript">
//<!--
//Usage: initRTE(imagesPath, includesPath, cssFile)
initRTE("images/", "", "");
//-->
</script>
<script language="JavaScript" type="text/javascript">
<!--
//Usage: writeRichText(fieldname, html, width, height, buttons, readOnly)
writeRichText('rte1', <? echo $contenido ?>, 520, 200, true, false);
//-->
</script>
<p><input type="Submit" name="Submit" value="Guardar"></p>

</form>
</td>
    <td width='10%'>&nbsp;</td>
  </tr> 
</table>
</body>
Código:
<?
$fichero = $_GET["fichero"];
$textoFinal = $_POST["texto"];
if($textoFinal != ''){
   if($fp = @fopen($fichero,"w+")){
      @fwrite($fp,stripslashes($textoFinal));
      echo 'Archivo modificado<br><br>';
   }
   @fclose($fp);
}
$fp = @fopen($fichero,"r");
$contenido = @fread ($fp, filesize ($fichero));
@fclose($fp);
echo"
<table width='100%' border='0'>
  <tr>
    <td width='10%'>&nbsp;</td>
    <td width='80%' align='center'><br><h3>Modificar noticias</h3></td>
    <td width='10%'>&nbsp;</td>
  </tr>
  <tr>
    <td width='10%'>&nbsp;</td>
    <td width='80%' align='center'>
<form method='post'>
<script language='JavaScript' type='text/javascript'>
//<!--
//Usage: initRTE(imagesPath, includesPath, cssFile)
initRTE('images/', '', '');
//-->
</script>
<script language='JavaScript' type='text/javascript'>
<!--
//Usage: writeRichText(fieldname, html, width, height, buttons, readOnly)
writeRichText('rte1', ".$contenido.", 520, 200, true, false);
//-->
</script>
<p><input type='Submit' name='Submit' value='Guardar'></p>

</form>
</td>
    <td width='10%'>&nbsp;</td>
  </tr> 
</table>
</body>

";
?>