title: How to send POST request using html button
body: <p>I want to send post request using html button. I know it is easily done by jQuery ajax, but i do not want to use jquery and ajax. How can i do it? </p>
  
  <p>This my function</p>
  
  <pre><code>public function editProduct() {
      if($_SERVER['REQUEST_METHOD'] === 'POST') {
          echo 'You are authorized';
      } else {
          echo 'You are not authorized to access this page.';
      }
  }
  </code></pre>
  
  <p>This is my HTML button</p>
  
  <pre><code>&lt;button type="submit" onclick="location.href = '&lt;?=base_url().'company/admin/add_product/editProduct?&gt;';"&gt;Send Post Request&lt;/button&gt;
  </code></pre>