I'm having some trouble that I can't understand at all. When I post a message and save it in a DB, sometimes the returning string is the message it should be, but sometimes that string is empty. It isn't an issue with the characters because I'm writing the same thing all the time (texts such as "AAAAAAAAAAA") and despite being the same thing FCKeditor sometimes doesn't feel like sending my messages ![]()
I write a text and send it, then see it's empty. I write the same thing and send it again, then see it's empty. I write the same thing again... and it's OK! Then I try to send the same text again and guess what? It's empty! ![]()
The code is the following:
The function I use to open the editor (I also tried without using functions).
function abrirEditor($seccion, $texto) {
$oFCKeditor = new FCKeditor('parrafada');
$oFCKeditor->BasePath = 'editor/';
$oFCKeditor->ToolbarSet = $seccion;
$oFCKeditor->Value = $texto;
$oFCKeditor->Create();
}The form to send the message.
<form name="comentario<?php echo $noticia['id']; ?>" action="<?php echo $url; ?>" method="POST">
<div class="respuesta">
<p><b>Avatar:</b></p>
<table width="100%">
<tr>
<td align="left">
<?php ponerAvatarB($avatar['avatar']); ?>
</td>
<td width="70%">
<p><select onchange="elegirAvatar(this.value);cambioImagen(this.value,'<?php echo $avatar['avatar'] ?>');">
<option selected value="1">Usar avatar por defecto</option>
<option value="2">Usar otro avatar</option>
<option value="3">Subir un nuevo avatar</option>
</select>
</p>
</td>
</tr>
</table>
<p><b>Mensaje:</b></p>
<input type="hidden" name="id" value="<?php echo $noticia['id']; ?>">
<input type="hidden" name="avatar" value="<?php echo $avatar['avatar']; ?>">
<input type="hidden" name="autor" value="<?php echo $avatar['id']; ?>">
<?php abrirEditor('Comentarios',''); ?>
<p><input type="submit" name="enviar" class="enviar" value="Enviar"></p>
</div>
</form>After the message is sent
<?php
if ($_POST['parrafada']=='') {
echo("<h1>Error</h1>");
echo("No puedes enviar un comentario vacío.");
}
else {
$ip=obtIP();
$texto=mysql_real_escape_string(trim($_POST['parrafada']),$link);
$sql='INSERT INTO comentario(id_noticia, autor, fecha, avatar, comentario, ip) VALUES("'.$_POST['id'].'","'.$_POST['autor'].'",NOW(),"'.$_POST['avatar'].'","'.$texto.'","'.$ip.'")';
mysql_query($sql, $link) or die("<h1>Error</h1>".mysql_error());
}
?>What should I do?

Re: FCKeditor returns empty strings... sometimes
FCKeditor seems not to notice when I alter the initial value. For example, if $oFCKeditor->Value is set to "Example text", it'll post "Example text" even if I write something else.