echo-ing tiny editor contents sent to the database using php
<p>Am in need of help, please i need some help. I tried using the tinyeditor jquery in my webpage, the contents of the editor submits to the database successfully but with the html markups. Now when i tried to retrieve the data from the database and display it on another page, it brings the content out with all html tags. Please how can I correct this to display as a formatted text? Thankx.</p>

<p>the tinyeditor scripts used</p>

<pre><code>&lt;script&gt;
new TINY.editor.edit('editor',{
id:'input', // (required) ID of the textarea
width:584, // (optional) width of the editor
height:175, // (optional) heightof the editor
cssclass:'te', // (optional) CSS class of the editor
controlclass:'tecontrol', // (optional) CSS class of the buttons
rowclass:'teheader', // (optional) CSS class of the button rows
dividerclass:'tedivider', // (optional) CSS class of the button diviers
controls:['bold', 'italic', 'underline', 'strikethrough', '|', 'subscript', 'superscript', '|', 'orderedlist', 'unorderedlist', '|' ,'outdent' ,'indent', '|', 'leftalign', 'centeralign', 'rightalign', 'blockjustify', '|', 'unformat', '|', 'undo', 'redo', 'n', 'font', 'size', 'style', '|', 'image', 'hr', 'link', 'unlink', '|', 'print'], // (required) options you want available, a '|' represents a divider and an 'n' represents a new row
footer:true, // (optional) show the footer
fonts:['Verdana','Arial','Georgia','Trebuchet MS'],  // (optional) array of fonts to display
xhtml:true, // (optional) generate XHTML vs HTML
cssfile:'style.css', // (optional) attach an external CSS file to the editor
content:'starting content', // (optional) set the starting content else it will default to the textarea content
css:'body{background-color:#ccc}', // (optional) attach CSS to the editor
bodyid:'editor', // (optional) attach an ID to the editor body
footerclass:'tefooter', // (optional) CSS class of the footer
toggle:{text:'source',activetext:'wysiwyg',cssclass:'toggle'}, // (optional) toggle to markup view options
resize:{cssclass:'resize'} // (optional) display options for the editor resize
});

&lt;/script&gt;
</code></pre>

<p>and</p>

<pre><code>&lt;script&gt;
var editor = new TINY.editor.edit('editor', {
id: 'tinyeditor',
width: 500,
height: 175,
cssclass: 'tinyeditor',
controlclass: 'tinyeditor-control',
rowclass: 'tinyeditor-header',
dividerclass: 'tinyeditor-divider',
controls: ['bold', 'italic', 'underline', 'strikethrough', '|', 'subscript', 'superscript', '|',
    'orderedlist', 'unorderedlist', '|', 'outdent', 'indent', '|', 'leftalign',
    'centeralign', 'rightalign', 'blockjustify', '|', 'unformat', '|', 'undo', 'redo', 'n',
    'font', 'size', 'style', '|', 'link', 'unlink', '|', 'print'],
footer: false,
fonts: ['Verdana','Arial','Georgia','Trebuchet MS'],
xhtml: true,
cssfile: 'custom.css',
bodyid: 'editor',
footerclass: 'tinyeditor-footer',
resize: {cssclass: 'resize'}
      }
);

&lt;/script&gt;
</code></pre>

<p><strong>the form that posts to the database</strong></p>

<pre><code>&lt;form action="upload_poetry.php" method="post"
 enctype="multipart/form-data"&gt;
                &lt;table width="100%" height="137" border="0" cellpadding="5" cellspacing="5"&gt;

                  &lt;tr&gt;
                    &lt;td align="right" valign="top"&gt;&lt;strong&gt;Poem:&lt;/strong&gt;&lt;/td&gt;
                    &lt;td&gt;.
                      &lt;label for="tinyeditor"&gt;&lt;/label&gt;
                    &lt;textarea name="tinyeditor" id="tinyeditor" cols="45" rows="5"&gt;&lt;/textarea&gt;&lt;/td&gt;
                &lt;/tr&gt;
                  &lt;tr&gt;
                    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                    &lt;td&gt;&lt;input type="submit" name="button" id="button" value="Submit"  onclick="editor.post()"/&gt;&lt;/td&gt;
                &lt;/tr&gt;

              &lt;/table&gt;
              &lt;/form&gt;
</code></pre>

<p><strong>codes used to insert into database</strong></p>

<pre><code>&lt;?php
include ('config.php');

$poem=$_POST['tinyeditor'];


$sql= "insert into poetry ( poem)values('$poem')";
$query=mysqli_query($dbC, $sql) or die(mysqli_error());
if ($query){

$msg = "Entry submitted pending Admin approval";
    header("location:poem.php?msg=$msg");
}
else{$msg = "Not submitted Please retry";
    header("location:poem.php?msg=$msg");}


?&gt;
</code></pre>

<p>codes used to retrieve from the database </p>

<pre><code>&lt;?php
                     include('config.php');
                     if (isset($_GET['id'])){
                     $id = $_GET['id'];
                     $sql = "SELECT * FROM poetry where title_id=$id";
                     $query = mysqli_query($dbC, $sql) or die(mysqli_error());
                     while($row = mysqli_fetch_array($query)){

                          $poem = $row['poem'];

                     }

                     ?&gt;
                     &lt;table width="50%" border="0" cellspacing="1" cellpadding="1"&gt;
                       &lt;tr&gt;
                       &lt;td&gt;&lt;strong&gt;Poem:&lt;/strong&gt;&lt;/td&gt;
                         &lt;td colspan="4"&gt;&lt;textarea id="" name="" &gt;&lt;?php echo $poem ?&gt;&lt;/textarea&gt; &lt;/td&gt;
                       &lt;/tr&gt;

                     &lt;/table&gt;
                       &lt;?php
                     }
                     echo "&lt;p&gt;&lt;a href='index.php&gt;Select an applicant to view his/her particulars&lt;/a&gt;&lt;/p&gt;";
                     ?&gt;
</code></pre>
