title: PHP onclick confirm to Sweet Alert 2 confirmation
body: <p>I need your help here please.I have a button which is echoed by a PHP file to a HTML file. When the button is clicked it uses window <code>confirm()</code> method but I want to use a sweet alert 2 modal to be displayed with yes or no option in the HTML file.</p>
  
  <p>Does anyone have any idea how I can make this work?</p>
  
  <p>PHP echo:</p>
  
  <pre><code>$row['handler'] = "&lt;a class=\"btn btn-detail btn-small\" href=\"user.php?act=cancel_order&amp;order_id=".$row['order_id'].
  "\" onclick=\"if (!confirm('".$GLOBALS['_LANG']['confirm_cancel'].
  "')) return false;\"&gt;".$GLOBALS['_LANG']['cancel'].
  "&lt;/a&gt;";
  </code></pre>
  
  <p>Do I need to add the script to a external file and call it inside PHP or there is better way to do this ?</p>