title: Access Forbidden Error
body: <p>I am trying to create Pagination using PHP, trying to show 5 records per page. Everything works just fine but when I click Pagination links to go to the next page it show an error message. </p>
  
  <blockquote>
    <p>Access forbidden!</p>
    
    <p>You don't have permission to access the requested object. It is either
    read-protected or not readable by the server.</p>
    
    <p>If you think this is a server error, please contact the webmaster.</p>
    
    <p>Error 403</p>
    
    <p>localhost Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30 </p>
  </blockquote>
  
  <p>Here is my code.</p>
  
  <pre><code>&lt;?php
          define("SPP", 5);
      if(isset($_GET['groupname']) &amp;&amp; isset($_GET['uniname'])) {
          /* VARS */
          $xpage = 0;
          $content = null;
          $totalProfile;
          $totalPage = 0;
          if(isset($_GET['xpage'])) { $xpage = $_GET['xpage'];    }
          $start = $xpage*SPP;
          $end = $start+SPP;
          include("protected/config.php");
          include("protected/class.db.php");
          include("protected/publicLang.php");
  
          $newSearch = new DB();
          $newSearch-&gt;query("SELECT username, university,bgroup, (SELECT COUNT(id) FROM donors) AS totalProfile FROM donors WHERE bgroup = :bgroup LIMIT " . $start . ", " . $end . " ");
          $newSearch-&gt;exec(array(
              ":bgroup" =&gt; $_GET['groupname']
          ));
          $data = $newSearch-&gt;fetch();
          foreach($data as $row) {
  
              $totalProfile = $row['totalProfile'];
          $content .= '
                  &lt;tr&gt;
                  &lt;td&gt;' . $row['username'] . '&lt;/td&gt;
                  &lt;td&gt;'.$row['university'].'&lt;/td&gt;
                  &lt;td&gt;' . convertBloodIdPublic($row['bgroup']) . '&lt;/td&gt;
                  &lt;td&gt;&lt;button class="btn btn-success"&gt;Contact&lt;/button&gt;&lt;/td&gt;
                  &lt;/tr&gt;   ';
          }
          $totalPage = round($totalProfile/SPP); }
  ?&gt;
  &lt;div class="container records"&gt;
  &lt;table&gt;
    &lt;tr&gt;
      &lt;th&gt;--&lt;/th&gt;
      &lt;th&gt;--&lt;/th&gt;
      &lt;th&gt;--&lt;/th&gt;
      &lt;th&gt;--&lt;/th&gt;
    &lt;/tr&gt;
    &lt;?php echo $content ?&gt;
  &lt;/table&gt;
  &lt;ul class="pagination"&gt;
  &lt;?php
      for($i=1; $i&lt;=$totalPage; $i++) {
          echo '&lt;li&gt;&lt;a href="&lt;?php echo ' . $_SERVER['REQUEST_URI'] . '"&amp;xpage"' . $i . ' ?&gt;"&gt;' . $i . '&lt;/a&gt;&lt;/li&gt;';}
  ?&gt;
  &lt;/ul&gt;
  </code></pre>