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. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.