title: How to secure $_SERVER['PHP_SELF']?
body: <p>I am using this code below to control pagination.  It's using <code>$_SERVER['PHP_SELF']</code> so I wanted to know if its secure this way or what do I have to do to make <code>$_SERVER['PHP_SELF']</code> secure?</p>
  
  <pre><code>&lt;?php 
  
      if($rows &gt; 10) {
          echo '&lt;a id=nex href="'.$_SERVER['PHP_SELF'].'?pg='.($startrow+10).'"&gt;
          Next&lt;/a&gt;';
      } 
  
      $prev = $startrow - 10;
  
      if ($prev &gt;= 0) {
          echo '&lt;a id=pex href="'.$_SERVER['PHP_SELF'].'?pg='.$prev.'"&gt;
          Previous&lt;/a&gt;';
      }
  
  ?&gt;
  </code></pre>