Code: Select all
0'>Nexti've been looking at it for a bit now and i can't figure out my problem, so if you could tell me what im doing wrong......thanks
Moderator: General Moderators
Code: Select all
0'>NextCode: Select all
<?php
$max_per_page=10;
$start_from=$_GET['start_from'];
$folder = "images/"; //folder name
if($handle = opendir($folder)) //open the folder
{
$i=0;
while($files = readdir($handle)) // $files will loop through every file in the directory
{
if ($files != "." && $files != "..") // readdir returns "." and ".." but they arent' actual files, so strip them out
{
if($i<$start_from) continue;
elseif ($i<$start_from+$max_per_page) break;
else echo "<center><img src=".$folder.$files."></center><br>";
}
}
}
echo "
<ahref='index.php?start_from=".$start_from-$max_per_page."'>
Prev</a>
<ahref='index.php?start_from=".$start_from+$max_per_page."'>
Next</a>";
?>Code: Select all
$i = 17;Code: Select all
0'>Next