title: call a javascript confirm dialog within php
body: <p>I'm trying to call a javascript confirm dialog box inside my php script,this doesn't seem to work, am i doing something wrong, is the a better way do this, here's an example of the code:</p>
  
  <pre><code>&lt;?php
     echo "&lt;script language=\"javascript\"&gt;";
         echo "var answer = confirm(\"Are you sure you want to delete this Buyer?\")";
         echo "if (answer !=0) { ";
             $g-&gt;DelBuyer($reg);
         echo "}else{";
             echo" You preesed cancel";
         echo "}";
      echo "&lt;/script&gt;";
  enter code here
  </code></pre>