title: Storing formated text in sql php
body: <p>I have created a certain form for my website that includes a Textarea with formatted text option so that the user can bold, underline, italics but also insert bulleted points and ordered list or even changing the font type and size.</p>
  
  <p>The problem is when the user opts to insert ordered list then click the submit button the information is stored in the server as [ol] enclosed in square brackets which is not appropriate especially when I want to display the information on the website so I was thinking  maybe if the information could be stored as  enclosed in HTML tags it will make it easier for displaying the information on the website whenever such information is called.</p>
  
  <p>My question is how can I store the information in tags(&lt;>) instead of the ones enclosed in square brackets[]?</p>
  
  <p>here is the code that gets the data from the form I tried to use the htmlspecialchars function but it didn't work.</p>
  
  <pre><code>    &lt;?php
      session_start();
      include 'connect.php';
      $servername = $_SERVER['PHP_SELF'];
      $username = 'root';
      $password = '';
      $dbname = 'members';
      $tablename = 'jobs';
      if (isset($_SESSION['username'])){ $sessionuser = 
      $_SESSION['username'];}
      else if (isset($_SESSION['company'])){$sessionuser = 
      $_SESSION['company'];}
  
      if(isset($_POST['company_name'])){
      $company_name = $_POST['company_name'];
      } 
      else if(isset($_SESSION['company'])){ $company_name = $_POST['company']; 
      }
  
      $company_website = $_POST['company_website'];
      $job_requirement = htmlspecialchars($_POST['job_requirement']);
      $location = $_POST['location'];
      $job_title = $_POST['job_title'];
  
      $application_email_url = $_POST['application_email_url'];
      $application_deadline = $_POST['application_deadline'];
      $category = $_POST['category'];
      $job_type = $_POST['job_type'];
  
  
  
  
      if($_SERVER['REQUEST_METHOD']){
      $sql = "INSERT INTO $tablename (`Company_name`, `Company_website`, 
      `Job_requirement`, `Location`, `Job_title`, `Application_deadline`, 
      `Category`, `Job_type`, `username`,`application_email_url`)
      VALUE('$company_name', '$company_website', '$job_requirement', 
      '$location', '$job_title', '$application_deadline', '$category', 
      '$job_type', '$sessionuser', '$application_email_url')";}
      if($conn-&gt;query($sql)===TRUE){ print "your job has been posted";}
      else{echo "error" .$conn-&gt;error;}
      ?&gt;
  </code></pre>