Showing active page with pagination
<p>So i have a webpage, and i paginated it. The problem is, that it doesn't show which page i'm currently on and also a next-previous-first-last button. How can i do this? Here is my current code:</p>

<pre><code>&lt;?php
$dataArray = array();
//Number of chars for the string
$num = 500;
$dir = '../php/biralas_tortenetek/';
$willcount = readdir(opendir($dir));
$i = -1;
//Check if &lt;/div&gt;DIR e&lt;/div&gt;xists
if ($handle = opendir($dir)) {
    //Loop over the directory
    while (false !== ($file = readdir($handle))) {
        //Strip out the . and .. files
        if ($file != "." &amp;&amp; $entry != "..") {
            //Store file contents
            $filecontent = file_get_contents($dir . $file);
            //Split the content and store in array
            $length = strlen($filecontent);
            $dataArray[$i++] = array(substr($filecontent, 0, $num), substr($filecontent, $num, $length ));

        }
    }
    //close the dir
    closedir($handle);
}
$totfiles = $i;

$page = isset($_GET['page']) ? $_GET['page']-1 : 0;
echo "&lt;br/&gt;";

 for($x=$page*1; $x &lt; $totfiles &amp;&amp; $x &lt; ($page+1)*1; $x++) {
    $data = $dataArray[$x];
    ?&gt;
        &lt;div class="visible"&gt;
            &lt;?php echo $data[0] . $data[1]; ?&gt;
        &lt;/div&gt;
&lt;?php 
} 

for($page=1; ($page-1)*1 &lt; $totfiles; $page++)
{
    echo "&lt;div class='lapozo'&gt;&lt;a onclick='story_changepage($page);' href='../html/blog.php#tortenetek?page=$page'&gt;$page&lt;/a&gt;&lt;/div&gt;"; 
}
?&gt;
</code></pre>

<p>Sorry for the full code, i'm lazy to sort out only the related code:P</p>

<p>Thanks folks!</p>
