Data not displaying in HTML format retrieved from database using PHP
<p>I am having an issue where I am having a user enter information into a textarea and and having that information stored in a mysql database.  The user is allowed to insert HTML into the textarea such as:</p>

<pre><code>&lt;ul&gt;
  &lt;li&gt;Test&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>However, I am having trouble seeing why the data that is being retrieved from the database to display the data the user has entered, is not showing the correct HTML format the user requested.</p>

<p>This is what I have:
Displaying the information:</p>

<pre><code>&lt;?php
function display ($result) {
  if (mysql_num_rows($result) &gt; 0) {
    echo "&lt;form action='scripts/submit.php' method='post'&gt;";
      echo "&lt;input type='submit' name='post' value='Post'/&gt;";
      echo " | ";
      echo "&lt;label for='searchDate'&gt;Search Archives By Date:&lt;/label&gt;";
      echo "&lt;input type='text' name='searchDate'&gt;";
      echo "&lt;input type='submit' name='submitDate' value='Search'/&gt;";
      echo " | ";
      echo "&lt;label for='searchTicket'&gt;Search Archives By Ticket:&lt;/label&gt;";
      echo "&lt;input type='text' name='searchTicket'/&gt;";
      echo "&lt;input type='submit' name='submitTicket' value='Search'/&gt;";
      echo "&lt;hr/&gt;";
    echo "&lt;/form&gt;";
    echo "&lt;table border='1' id='resultTable'&gt;";
      while($row = mysql_fetch_assoc($result)) {
      $replace = str_replace ("\n","&lt;br/&gt;",$row['content']);
      echo "&lt;tr&gt;";
        echo "&lt;td&gt;&lt;span id='boldText'&gt;Entry By:&lt;/span&gt; ".$row['user']." | &lt;span id='boldText'&gt;Description:&lt;/span&gt; ".$row['description']." | &lt;span id='boldText'&gt;Entry Date:&lt;/span&gt; ".$row['date']."&lt;/td&gt;";
      echo "&lt;/tr&gt;";
      echo "&lt;tr&gt;";
        echo "&lt;td&gt;";
            echo "&lt;p&gt;".$replace."&lt;/p&gt;";
        echo "&lt;/td&gt;";
      echo "&lt;/tr&gt;";
      echo "&lt;tr&gt;";
        echo "&lt;td&gt;";
          echo "&lt;form action='scripts/submit.php' method='post'&gt;";
            echo "&lt;input type='hidden' name='count' value='$row[count]'/&gt;";
            echo "&lt;input type='submit' name='edit' value='Edit'/&gt;";
            echo "&lt;input type='submit' name='delete' value='Delete'/&gt;";
          echo "&lt;/form&gt;";
        echo "&lt;/td&gt;";
      echo "&lt;/tr&gt;";
          }
          echo "&lt;/table&gt;";
      }
      else {
        echo "&lt;h3 id='noResults'&gt;Nothing has been posted yet.  Click 'Post' to add something to the whiteboard.&lt;/h3&gt;";
        echo "&lt;form action='scripts/submit.php' method='post'&gt;";
          echo "&lt;input type='submit' name='post' value='Post'/&gt;";
        echo "&lt;/form&gt;";
      }
}

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

<p>Add Post Logic:</p>

<pre><code>if(isset($_POST['add_post'])) {
$content = mysql_real_escape_string($_POST['content']);
$description = mysql_real_escape_string($_POST['desc']);

  $query = "INSERT INTO $table_name (user, description, content)
            VALUES ('$_SESSION[logged_in]','$description', '$content')";
  $result = mysql_query($query);
  session_write_close();
  header('Location: ../whiteboard.php');
}
</code></pre>

<p>For some reason the example above will not work, but this will:</p>

<pre><code>&lt;p style="font-weight: 900;"&gt;Test&lt;/p&gt;
</code></pre>
