title: 500 Internal Server Error When I Submit Form
body: <p>I have one simple form when i click submit form in online we have internal error 500 but after submitting form i have updated data.</p>
  
  <p>it is working good  locally but submitting form  online  have the same issue.</p>
  
  <p>I added my code here,</p>
  
  <pre><code>&lt;form action="purchase.php" method="post"&gt;
  &lt;div class="row"&gt;
  
          &lt;div class="col-md-2"&gt;
              Medicine name :
          &lt;/div&gt;
  
          &lt;div class="col-md-4"&gt;
              &lt;div class="input-field"&gt;
                 &lt;input type="text" class="form-control" name="productName" placeholder="" required&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;br /&gt;
      &lt;div class="row"&gt;
  
          &lt;div class="col-md-2"&gt;
              Brand Name :
          &lt;/div&gt;
  
          &lt;div class="col-md-4"&gt;
              &lt;div class="input-field"&gt;
                 &lt;input type="text" class="form-control" name="brandName" placeholder="" required&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;br /&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-md-2"&gt;
              Medicine Strenght :
          &lt;/div&gt;
          &lt;div class="col-md-4"&gt;
              &lt;div class="input-field"&gt;
                 &lt;input type="text" class="form-control" name="productPow" placeholder="" required&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;br /&gt;
      &lt;div class="row"&gt;
  
          &lt;div class="col-md-2"&gt;
              Medicine Form :
          &lt;/div&gt;
  
          &lt;div class="col-md-4"&gt;
              &lt;div class="input-field"&gt;
                 &lt;select name="productType" class="form-control" onchange='Check(this.value);'&gt;
                 &lt;option id="txt1"&gt;Capsule&lt;/option&gt;
                 &lt;option id="txt1"&gt;Tablet&lt;/option&gt;
                 &lt;option id="txt1"&gt;Syrup&lt;/option&gt;
                 &lt;option id="txt1"&gt;Injection&lt;/option&gt;
                 &lt;option id="txt1"&gt;Ointment&lt;/option&gt;
                 &lt;option id="txt1"&gt;Cream&lt;/option&gt;
                 &lt;option id="txt1"&gt;Gel&lt;/option&gt;
                 &lt;option id="txt1"&gt;Lotion&lt;/option&gt;
                 &lt;option id="txt1"&gt;Shampoo&lt;/option&gt;
                 &lt;option id="txt1"&gt;Susp&lt;/option&gt;
                 &lt;option id="txt1"&gt;Liniment&lt;/option&gt;
                 &lt;option id="txt1"&gt;Bar&lt;/option&gt;
                 &lt;option id="txt1"&gt;Soap&lt;/option&gt;
                 &lt;option id="txt1"&gt;FaceWash&lt;/option&gt;
                 &lt;option id="txt1"&gt;Oil&lt;/option&gt;
                 &lt;option id="txt1"&gt;Powder&lt;/option&gt;
                 &lt;option id="others"&gt;others&lt;/option&gt;
                 &lt;/select&gt;
  
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="col-md-3"&gt;
             &lt;input type="text" class="form-control" name="productType1" id="txt" style="display:none;"&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;br /&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-md-2"&gt;
              Product Company :
          &lt;/div&gt;
          &lt;div class="col-md-4"&gt;
              &lt;div class="input-field"&gt;
                 &lt;input type="text" class="form-control" name="productCom" placeholder="" required&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;br /&gt;
     &lt;div class="row"&gt;
          &lt;div class="col-md-2"&gt;
              Batch No :
          &lt;/div&gt;
          &lt;div class="col-md-4"&gt;
              &lt;div class="input-field"&gt;
                 &lt;input type="text" class="form-control" name="batch" placeholder="" required&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;br /&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-md-2"&gt;
              Manufacturing Date :
          &lt;/div&gt;
          &lt;div class="col-md-4"&gt;
              &lt;div class="input-field"&gt;
                 &lt;input type="text" class="form-control" id="start" name="productMdate" placeholder="mm/yyyy" required&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;br /&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-md-2"&gt;
              Expiry Date :
          &lt;/div&gt;
          &lt;div class="col-md-4"&gt;
              &lt;div class="input-field"&gt;
                 &lt;input type="text" class="form-control" id="end" name="productEdate" placeholder="mm/yyyy" required&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;br /&gt;
       &lt;div class="row"&gt;
          &lt;div class="col-md-2"&gt;
              Quantity :
          &lt;/div&gt;
          &lt;div class="col-md-4"&gt;
              &lt;div class="input-field"&gt;
                 &lt;input type="text" class="form-control" name="productQty" id="productQty" placeholder="" required&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;br /&gt;
       &lt;div class="row"&gt;
          &lt;div class="col-md-2"&gt;
              MRP :
          &lt;/div&gt;
          &lt;div class="col-md-4"&gt;
              &lt;div class="input-field"&gt;
                 &lt;input type="text" class="form-control" name="productMRP" placeholder="" required&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;br /&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-md-2"&gt;
              Price Per Quantity :
          &lt;/div&gt;
          &lt;div class="col-md-4"&gt;
              &lt;div class="input-field"&gt;
                 &lt;input type="text" class="form-control" name="PQty" placeholder="" required&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;br /&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-md-2"&gt;
              Actual Price :
          &lt;/div&gt;
          &lt;div class="col-md-4"&gt;
              &lt;div class="input-field"&gt;
                 &lt;input type="text" class="form-control" name="productAPrice" id="productAPrice" placeholder="" required&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;br /&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-md-2"&gt;
              VAT :
          &lt;/div&gt;
          &lt;div class="col-md-4"&gt;
              &lt;div class="input-field"&gt;
                 &lt;input type="text" class="form-control" name="productVAT" id="productVAT" onkeyup="purchasecal();"&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;br /&gt;
     &lt;div class="row"&gt;
          &lt;div class="col-md-2"&gt;
              Price :
          &lt;/div&gt;
          &lt;div class="col-md-4"&gt;
              &lt;div class="input-field"&gt;
                 &lt;input type="text" class="form-control" name="productPrice" id="productPrice" placeholder="" required&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="row"&gt;
      &lt;div class="col-md-12"&gt;
      &lt;input type="submit" class="btn btn-blue pull-right" value="SUBMIT" name="msg-submit"&gt;&lt;br /&gt;
  
      &lt;/div&gt;
      &lt;/div&gt;
      &lt;/form&gt;
      &lt;div class="row"&gt;
      &lt;div class="col-lg-12 col-md-12 col-sm-12"&gt;
      &lt;!--&lt;iframe name="viewside" src="purchase_entry.php" width="100%"  
          height="700px" frameBorder="0"&gt; 
      &lt;/iframe&gt;--&gt;
      &lt;/div&gt; 
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/section&gt;
  &lt;?php
  include_once('connect_db.php');
  if(isset($_POST['msg-submit'])){
  $productName=$_POST['productName'];
  $brandName=$_POST['brandName'];
  $productPow=$_POST['productPow'];
  
  $productType=$_POST['productType'];
  
  $productCom=$_POST['productCom'];
  $batch=$_POST['batch'];
  $productMdate=$_POST['productMdate'];
  $productEdate=$_POST['productEdate'];
  $productQty=$_POST['productQty'];
  $productPrice=$_POST['productPrice'];
  $PQty=$_POST['PQty'];
  $productAPrice=$_POST['productAPrice'];
  $productVAT=$_POST['productVAT'];
  $productMRP=$_POST['productMRP'];
  
  
  $sql="INSERT INTO xxx (product_name, product_brand, product_power, product_type, product_Com, batch_no, manufacturing_date, expiry_date, quantity, price, ppq, actual_price, vat, mrp, Purchase_Date, Stock_Count) VALUES ( '$productName','$brandName', '$productPow', '$productType', '$productCom', '$batch', '$productMdate', '$productEdate', '$productQty', '$productPrice', '$PQty', '$productAPrice', '$productVAT', '$productMRP', DATE_FORMAT(NOW(),'%d/%m/%Y'), '$productQty')";
  mysql_query($sql);
  }
  </code></pre>