title: JS Call PHP Function
body: <p>I PHP code function, now I want the function will appear with button click.</p>
  
  <p>Here is my PHP code function :</p>
  
  <pre><code>function prints()
  {
      header('Content-type: application/excel');
      $filename = 'LEGO_PRODUCTION_RESULT_NG.xls';
      header('Content-Disposition: attachment; filename='.$filename);
      $data = "&lt;html xmlns:x='urn:schemas-microsoft-com:office:excel'&gt;
      &lt;head&gt;
          &lt;!--[if gte mso 9]&gt;
          &lt;xml&gt;
              &lt;x:ExcelWorkbook&gt;
                  &lt;x:ExcelWorksheets&gt;
                      &lt;x:ExcelWorksheet&gt;
                          &lt;x:Name&gt;Sheet 1&lt;/x:Name&gt;
                          &lt;x:WorksheetOptions&gt;
                              &lt;x:Print&gt;
                                  &lt;x:ValidPrinterInfo/&gt;
                              &lt;/x:Print&gt;
                          &lt;/x:WorksheetOptions&gt;
                      &lt;/x:ExcelWorksheet&gt;
                  &lt;/x:ExcelWorksheets&gt;
              &lt;/x:ExcelWorkbook&gt;
          &lt;/xml&gt;
          &lt;![endif]--&gt;
      &lt;/head&gt;";
  
      echo $data;
  }
  </code></pre>
  
  <p>HTML button :</p>
  
  <pre><code>&lt;input type="button" value="Export to Excel"/&gt;
  </code></pre>
  
  <p>So how can I add JS function to call the PHP function on click button?</p>