title: php destroy session and delete record from mysql on closing browser / tab
body: <p>i have Question Answers quizes php forms... when user answers the questions at the end he/she will get the result.</p>
  
  <p>i want that if in a quiz there are 5 questions and user close the browser or tab after submitting 1 question. i want that if user close the browser or tab or if that page is opened in lightbox iframe, upon closing his submitted data will be deleted from the database based on session id.</p>