I’ll try to be clear in the question,i need to display HTML content on a .Let me explain what i trying to do.
1-On my main file i have a which sends the text inserted to a mysql table.(OK)
2-After on the same page PHP execute a query and search for the rows containing an id inserted together with the message.(OK)
3-After the PHP found the rows with the same id i display these messages using the code bellow(the messages are displayed on a textarea):
while ($runrows = mysql_fetch_assoc($run_two)){
$horario = $runrows['added'];
$autor = $runrows['autor'];
$mensagem = $runrows['mensagem'];
$codigosender = $runrows['codigosender'];
$testevar = htmlspecialchars($mensagem);
echo"
<center>
<table width='500px;'>
<tr><td width='75%'>$autor</td><td width='25%'>$horario</td></tr>
</table>
<textarea name='displayMessages' style=' width:500px;' readonly>$testevar</textarea>
</center>
";
}
Now is my problem: If i insert on my sender the message ‘(bold tag)Mateus(bold tag)‘,when the PHP display on the textarea it doesn’t display the ‘Mateus’ in bold!So how can i enable the textarea to do so?(Basically i want to enable my textarea to work as this one i writing now).
HTML textarea will not have any styling for the value it contents.
if you wish to give styling you will need to use third party controls. like CKEditor, or freetext Box, otherwise you will need to create your own textarea.