title: How to use bootstrap pagination with php
body: <p>I am a working with php and mysql and I managed to do pagination following this tutorial:
  <a href="http://www.phpfreaks.com/tutorial/basic-pagination" rel="nofollow">http://www.phpfreaks.com/tutorial/basic-pagination</a></p>
  
  <p>Here is "mywebpage" (on work): <a href="http://ada.uprrp.edu/~ehazim/hpcf_proj/miejemplo.php" rel="nofollow">http://ada.uprrp.edu/~ehazim/hpcf_proj/miejemplo.php</a></p>
  
  <p>But Now, I want to make it "pretty" using bootstrap Pagination:<a href="http://getbootstrap.com/components/#pagination" rel="nofollow">http://getbootstrap.com/components/#pagination</a></p>
  
  <p>I am using _GET['current_page'] to get the page where I am. The problem is that I dont know how to change the echo's to echo the pagination from bootstrap... Yes, it may be stupid, but It is my first time with php and I am like 2 hours just trying to do this. Can someone help me? Below is the code that I have, following the tutorial of php freaks (which I understand, except for some echos with toomany quotes :/ ):</p>
  
  <pre><code>    &lt;div class="pagination"&gt;
      &lt;ul&gt;
  
      &lt;?php
      /******  build the pagination links ******/
      // if not on page 1, don't show back links
      if ($currentpage &gt; 1) {
          // show &lt;&lt; link to go back to page 1
          # TRYING TO CHANGE HERE AND IN OTHER ECHOS  
          #echo "&lt;li&gt;&lt;a href=\"{$_SERVER['PHP_SELF']}?currentpage=1\"&gt;&amp;laquo;&lt;/a&gt;&lt;/li&gt;";
          echo " &lt;a href='{$_SERVER['PHP_SELF']}?currentpage=1'&gt;&lt;&lt;&lt;/a&gt; ";
          // get previous page num
          $prevpage = $currentpage - 1;
          // show &lt; link to go back to 1 page
          #echo " &lt;li&gt;&lt;a href='{$_SERVER['PHP_SELF']}?currentpage=$prevpage'&gt;&lt;&lt;/a&gt; ";
          echo " &lt;a href='{$_SERVER['PHP_SELF']}?currentpage=$prevpage'&gt;&lt;&lt;/a&gt; ";
      } // end if
  
      # range of num links to show
      $range = 3;
  
      # loop to show links to range of pages around current page
      for ($x = ($currentpage - $range); $x &lt; (($currentpage + $range)  + 1); $x++) {
          // if it's a valid page number...
          if (($x &gt; 0) &amp;&amp; ($x &lt;= $totalpages)) {
          // if we're on current page...
              if ($x == $currentpage) {
              // 'highlight' it but don't make a link
                  echo " [&lt;b&gt;$x&lt;/b&gt;] ";
          // if not current page...
          }
          else {
              // make it a link
              echo " &lt;a href='{$_SERVER['PHP_SELF']}?currentpage=$x'&gt;$x&lt;/a&gt; ";
          } // end else
      } // end if 
  } // end for
  
  
      // if not on last page, show forward and last page links        
      if ($currentpage != $totalpages) {
          // get next page
          $nextpage = $currentpage + 1;
          // echo forward link for next page 
          echo " &lt;a href='{$_SERVER['PHP_SELF']}?currentpage=$nextpage'&gt;&gt;&lt;/a&gt; ";
          // echo forward link for lastpage
          echo " &lt;a href='{$_SERVER['PHP_SELF']}?currentpage=$totalpages'&gt;&gt;&gt;&lt;/a&gt; ";
       } // end if
       # end build pagination links 
  ?&gt;
  
  &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>