how do i write a javascript alert box to give a yes or no question and integrate with php calls?
<p>i am trying to figure out how to create a javascript alert box asking the user if they would like to delete a record (that their viewing) and when the user presses yes a query is called through php to delete a database row. and if the user presses no nothing will happend.</p>

<p>wondering how this can be done</p>

<p>thanks</p>

<p>ps:</p>

<p>this is what i did and it didnt work.</p>

<pre><code>&lt;script type="text/javascript"&gt;
if(window.confirm("Are you sure you want to delete that record?")) { 
&lt;?php
mysql_query("delete from tbl_payments where id = '$id'") or die(mysql_error());
header("Location: dashboard.php");
?&gt;
}
&lt;/script&gt;
</code></pre>
