title: PHP: Detect Page Refresh
body: <p>I have a page <code>action.php</code> on which I run an SQL query through the code, so that whenever the page is viewed the query runs like <strong>its like counting page views</strong></p>
  
  <pre><code>&lt;?php
  mysqli_query("UPDATE ****");
  ?&gt;
  </code></pre>
  
  <p>The problem is when the page is refreshed, the query is run &amp; PAGE REFRESH is counted as a PAGE VIEW which I want to avoid.</p>
  
  <p><strong>&nbsp;&nbsp;&nbsp;Question:</strong> How to avoid it ?</p>
  
  <p>What I am looking for is a simple solution so that I can check </p>
  
  <pre><code>if( page was refresh ) //some condition
  {
   do
  }
  </code></pre>