I have on a website a small CMS (based on SCC Editor) that allows you to create ordered and unordered lists, bold, italics and something else. As writing in the database the text of that textarea where the CMS works included the tags in [] [/] format, I applied a strreplace like this:
//Crear parrafos y reemplazar corchetes
$articulo = $_POST['articulo'];
$articulo = str_replace("[","<",$articulo);//cambiar abrir corchete por <
$articulo = str_replace("]",">",$articulo); //cambiar cerrar corchete por >
$InsertQuery->bindColumn("articulo", "s", "".((isset($articulo))?$articulo:"") ."", "WA_DEFAULT");
$InsertGoTo = "comprobar_post.php";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
$InsertQuery->redirect($InsertGoTo);
}
And it works, since in the bbdd he writes
<b>texto</b>
for a bold text.
The problem comes when I retrieve that text to include it in the publication that shows me
<b>texto</b>
instead of text as it should.
Here I put the select script:
<?php
$rsModificarPost = new WA_MySQLi_RS("rsModificarPost",$Prueba_MCC_i,1);
$rsModificarPost->setQuery("SELECT * FROM post ORDER BY post.p_id DESC");
$rsModificarPost->execute();
?>
And here I recover the text already in the body of the php document where it is published with its nl2br to generate appearances of line height:
<div style="color:#000000; font-weight:400; border-bottom:1px #CCC dotted; padding-bottom:20px;">
<?php echo nl2br($rsModificarPost->getColumnVal("articulo")); ?>
</div>
Can someone help me, please? Thank you very much