title: how do i write a javascript alert box to give a yes or no question and integrate with php calls? (repost)
body: <p>I'm reposting this post I just posted a while ago.
  <a href="https://stackoverflow.com/questions/1035266/how-do-i-write-a-javascript-alert-box-to-give-a-yes-or-no-question-and-integrate/1035285#1035285">how do i write a javascript alert box to give a yes or no question and integrate with php calls?</a></p>
  <p>I wasn't getting any more responses, so I figured the post got lost in somewhere out there.
  what I tried doing was this</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot;&gt;
      if(window.confirm(&quot;Are you sure you want to delete that record?&quot;)) { 
          &lt;?php
          mysql_query(&quot;delete from tbl_payments where id = '$id'&quot;) or die(mysql_error());
          header(&quot;Location: dashboard.php&quot;);
          ?&gt;
      }
  &lt;/script&gt;
  </code></pre>
  <p>and it didn't work. the record just got deleted once I pressed the link to delete.
  what am I doing wrong? thanks</p>
  <p>ps: I cant do ajax yet I'm looking for a simple way of doing it so I can comprehend how it works</p>
  <p>thanks</p>