title: php mysql + comment system
body: <p>i am creating social media website that have a comment system where the text writen by the user will be posted on the board  and stored in the database  but the problem is that no text is displayed and no text is stored in the database but other fields beside the text are stored so anyone can help me ???</p>
  
  <h1>profile .php</h1>
  
  <pre><code>&lt;?php  
  ob_start();
  session_start();
  require_once('for members/scripts/global.php'); 
  
  if($_SESSION['login'] != 'true'){
          header("location:index.php");
      }
  $user_id = $_SESSION['user_id'];
  $send =(isset($_POST['send']));
  $writenCom = (isset($_POST['post']));
  if($send &amp;&amp; $writenCom){
     echo $writenCom;
   $query = mysql_query("INSERT INTO comment(sender_id, text, comment_date)VALUES('$user_id', '$writenCom', now())")or die(mysql_error());
  
   while($row = mysql_fetch_array($query)){
  
   echo"comment success";
  
  
   }
  
  
  }
  
  ?&gt;
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;link href="style/stylesheet.css"rel="stylesheet" type="text/css"/&gt;
  &lt;title&gt;
  &lt;?php print($_SESSION['first_name']); ?&gt;
  &lt;?php print($_SESSION['last_name']); ?&gt;'s profile&lt;/title&gt;
  &lt;style type="text/css"&gt;
  
  &lt;/style&gt;
  
  
  
  &lt;link href="style/stylesheet.css" type="text/css"/&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;?php require_once('header.php'); ?&gt;
  
  &lt;div class="container center"&gt; 
  &lt;div class="postForm"&gt;
  &lt;form action="&lt;?php echo($_SESSION['first_name']); ?&gt;" method="post"&gt;
    &lt;textarea id="post" name="post" rows="5" cols="70"&gt; &lt;/textarea&gt;
    &lt;input type="submit" name="send" value="Post" style="background-color:#DCE5EE; float:right; border:1px solid #666; color:#666; height:73px; width:65px;" /&gt;
  &lt;/form&gt;
  
  &lt;/div&gt;
  
  
  &lt;div class="profilePost"&gt;Your Post will go here...
  
  &lt;/div&gt;
  &lt;!--for posting area --&gt;
  &lt;div class="textProfileHeader"&gt;&lt;?php echo($_SESSION['first_name']); ?&gt;'s profile&lt;/div&gt;
  
  
  &lt;!--end of posting --&gt;
  &lt;div class="profileImage"&gt;&lt;img src="image with highlight 2/images/new images/imageHover/homeHover.jpg" height="250" width="200" alt="&lt;?php echo($_SESSION['first_name']); ?&gt;'s profile" title="="&lt;?php echo($_SESSION['first_name']);?&gt;'s profile /&gt;&lt;/div&gt;
  
  &lt;div class="profiletextContent"&gt;Some Content about  this person profile...&lt;/div&gt;
  
  &lt;div class="textProfileHeaderFriends"&gt;&lt;?php echo($_SESSION['first_name']); ?&gt;'s Friends&lt;/div&gt;
  
  &lt;div class="profileImgFriends"&gt; &lt;img src="image with highlight 2/images/new images/imageHover/homeHover.jpg" height="50" width="40" /&gt;&amp;nbsp;&amp;nbsp; &lt;img src="image with highlight 2/images/new images/imageHover/homeHover.jpg" height="50" width="40" /&gt;&amp;nbsp;&amp;nbsp; &lt;img src="image with highlight 2/images/new images/imageHover/homeHover.jpg" height="50" width="40" /&gt;&amp;nbsp;&amp;nbsp; &lt;img src="image with highlight 2/images/new images/imageHover/homeHover.jpg" height="50" width="40" /&gt;&amp;nbsp;&amp;nbsp; &lt;img src="image with highlight 2/images/new images/imageHover/homeHover.jpg" height="50" width="40" /&gt;&amp;nbsp;&amp;nbsp; &lt;img src="image with highlight 2/images/new images/imageHover/homeHover.jpg" height="50" width="40" /&gt;&amp;nbsp;&amp;nbsp; &lt;img src="image with highlight 2/images/new images/imageHover/homeHover.jpg" height="50" width="40" /&gt;&amp;nbsp;&amp;nbsp; &lt;img src="image with highlight 2/images/new images/imageHover/homeHover.jpg" height="50" width="40" /&gt;&amp;nbsp;&amp;nbsp; &lt;/div&gt;
  
  &lt;!--
  &lt;form id="form" method="post" action="profile.php" enctype="multipart/form-data" target="iframe"&gt;
      &lt;input type="file" id="file" name="file" /&gt;
      &lt;input type="submit" name="submit" id="submit" value="Upload File" /&gt;
  &lt;/form&gt;
  --&gt;
  &lt;!--
  &lt;a href="#"&gt;edit profile&lt;/a&gt;&lt;br /&gt;
  &lt;a href="#"&gt;account settings&lt;/a&gt;&lt;br /&gt;
  --&gt;
  &lt;?php
  //}else{
      //header("Location: home.php");
  ?&gt;
  &lt;!--
  &lt;a href="#"&gt;private message&lt;/a&gt;&lt;br /&gt;
  &lt;a href="#"&gt;add as friend&lt;/a&gt;&lt;br /&gt;
  --&gt; 
  &lt;?php
  //}
  ?&gt;
  &lt;/div&gt;
  
  &lt;p&gt;&amp;nbsp;&lt;/p&gt;
  &lt;p&gt;&amp;nbsp;&lt;/p&gt;
  &lt;p&gt;&amp;nbsp;&lt;/p&gt;
  &lt;p&gt;&amp;nbsp;&lt;/p&gt;
  &lt;p&gt;&amp;nbsp;&lt;/p&gt;
  &lt;p&gt;&amp;nbsp;&lt;/p&gt;
  &lt;p&gt;&amp;nbsp;&lt;/p&gt;
  &lt;?php require_once('footer.php'); ?&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  
  &lt;?php flush(); ?&gt;
  </code></pre>