I have a entry in my mysql table that contains html code (<p>Hello!</p>)
This show up fine when I want to display it (echo $entry) but when I place echo $entry in a textarea value= it executes the code instead of showing it.
Is there any way to stop the code executing and show the tags or convert to and from < ; > ;
Here is the code:
echo "<label for=\"details\">Details:</label><textarea id=\"details\" cols=\"60\" rows=\"10\" name=\"details\" value=\"" . $row["details"]."\"></textarea>";
Here is the entry:
Set to 0 (on)</ol>
You have to escape special characters. You can do that with htmlspecialchars().
What's more, You should not set a value to the textarea but rather write it in its content:
<textarea> <?php /* some code here */ ?> </textarea>