At each UPDATE performed of the same text, the accented letter is duplicated

Asked

Viewed 59 times

0

With each update of the same text, the accented characters are duplicated.

See in the image below what happens every time I click update. As you can see, the letters that have some kind of accentuation are duplicated.

I do this so that accented characters are no longer duplicated?

inserir a descrição da imagem aqui

Form Code:

<?php
$painel=mysqli_query($con,"select detalhe_sobre from anuncios where id = '$idcli'");
while($painel_texto=mysqli_fetch_array($painel)){
$texto_empresa = utf8_encode(strip_tags(nl2br($painel_texto['detalhe_sobre'])));
}
?>
<form class="frm-adm-painel" action="gravar-texto.php?cliente=<?php echo $idcli; ?>" method="post">
    <textarea name="textoempresarial" rows="10" placeholder="Texto sobre a Empresa"><?php echo $texto_empresa;  ?></textarea>
    <button type="submit" name="botao">GRAVAR</button>
</form>

Code record:

<?php
if (!empty($_GET['cliente'])){
    $idcli = $_GET['cliente'];
    $textoempresarial = utf8_encode($_POST['textoempresarial']);
    $painel=mysqli_query($con,"UPDATE anuncios SET detalhe_sobre = '$textoempresarial' where id = '$idcli'");
    header("location: painel.php?cliente=$idcli");
}
?>
  • Indentations are cause pq of line breaking within the <textarea>, know q the goal was to make the code more readable, but remove the rest have to look calmly

  • About the special characters what happens if you just use $texto_empresa = $painel_texto['detalhe_sobre']; at the time of bringing in the database data?

  • @Erloncharles I removed the line breaks within the textarea and it worked. Now your second suggestion did not work, keeps adding special characters. In fact what happens is that if there is some kind of accentuation or cedilla in the text it duplicated at each update.

  • @Erloncharles If in the text there are no accented characters it updates perfectly. What makes it almost impossible a text without accentuation. rss

  • What file format is the form? is UTF-8?

  • @Erloncharles how I verify this information?

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.