<p>I've got a script that dynamically calls and displays images from a directory, what would be the best way to paginate this?  I'd like to be able to control the number of images that are displayed per page through a variable within the script.  I'm thinking of using URL varriables (ie - <a href="http://domain.com/page.php?page=1" rel="noreferrer">http://domain.com/page.php?page=1</a>) but am unsure how to go about this.</p>

<p>Thanks for the help.</p>

pagination is the same concept with or without sql. you just need your basic variables, then you can create the content you want. here's some quasi-code:
```
```
$itemsPerPage = 5;

$currentPage = isset($_GET['page']) ? $_GET['page'] : 1;
$totalItems = getTotalItems();
$totalPages = ceil($totalItems / $itemsPerPage);

function getTotalItems() {
// since they're images, perhaps we'll scan a directory of images to determine
// how many images we have in total
}

function getItemsFromPage($page, $itemsPerPage) {
// function to grab $itemsPerPage based on which $page we're on
}

function getPager($totalPages, $currentPage) {
// build your pager
}
```
```
hope that helps you get started!