title: How can I integrate javascript onclick function with php?
body: <p>I am having a problem with onclick function integrating it with php .Can someone please help</p>
  
  <p>Below is my codes </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;&lt;/title&gt;
  &lt;script language="Javascript"&gt;
  function delete()
  {
      val del=confirm("Do you wanto delete the player?");
      if(del==true)
      {
          alert("player Deleted");
      }
      else
      {
          alert("record not deleted");
      }
      return del;
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;?php 
  Echo “
  &lt;a href='delete.php?player_id=$player_id' onclick='delete()'&gt;Delete&lt;/a&gt;”
  ?&gt;
  </code></pre>