paulman888888 Posted May 9, 2008 Share Posted May 9, 2008 i have my code that includes all pages in my directory but how do i get it to only show 10 on each page. This is my code <?php $moduleHandle = opendir('games/'); $x = 1; while(false !== ($moduleFile = readdir($moduleHandle))){ if($moduleFile == "." || $moduleFile == ".." || $moduleFile == "demo.html" || $moduleFile == "..." || $moduleFile == "navigation.php")continue; // replace unused with any files you dont want to be included include("games/$moduleFile"); $x++; } if($showBack == "process"){ echo"Files Loaded Successfully: <b>$x</b><br>"; } closedir($moduleHandle); ?> Thankyou for all the help One more thing if you don't mind how do i make a next page link / button. Thankyou all very much. Link to comment https://forums.phpfreaks.com/topic/104896-max-of-10-per-page/ Share on other sites More sharing options...
GingerRobot Posted May 9, 2008 Share Posted May 9, 2008 Have a search for a pagination tutorial. You'll mostly come across these for mysql results, but the principles are the same. You'll need to read your includes into an array in the same order each time, then only use a selection of those for display depending on the page number. Link to comment https://forums.phpfreaks.com/topic/104896-max-of-10-per-page/#findComment-536827 Share on other sites More sharing options...
paulman888888 Posted May 9, 2008 Author Share Posted May 9, 2008 Am not very good with PHP and i didn't make this script. But thankyou anyway for the help. Link to comment https://forums.phpfreaks.com/topic/104896-max-of-10-per-page/#findComment-536836 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.