title: Display message when "back" button is pressed (PHP or JS?)
body: <p>I'm writing a PHP script and would like to present a warning message if the user clicks the back button on the browser.  <strong>Is this something I can do in PHP?</strong>  The only solution I've been able to find is via javascript, however it presents a warning message <em>every time something is submitted</em> on the page. If there is not a way to do this in PHP, can this javascript be altered to only work when the back button is pressed on the browser?  Thanks.</p>
  
  <pre><code> &lt;script type="text/javascript" language="javascript" defer="defer"&gt;
   window.onbeforeunload = eventTermination;
   function eventTermination(args) {
   args.returnValue = ('WARNING:CANNOT GO BACK');
   }
   &lt;/script&gt;
  </code></pre>