chanchelkumar Posted March 23, 2007 Share Posted March 23, 2007 Hi... i want to list the pages in the following manner... any one have the code please help me... Pages: [1] 2 3 4 5 6 ... 749 Link to comment https://forums.phpfreaks.com/topic/43935-list-the-pages/ Share on other sites More sharing options...
DeathStar Posted March 23, 2007 Share Posted March 23, 2007 Well its quite easy though.. But for what do you want it, ex: userlist, files .... Ill post my code here for you think you can just edit it then: $cnt = mysql_query("SELECT id FROM people"); $membs = mysql_num_rows($cnt); $pages = (int)($membs / 100) + 1; if ($membs % 100 == 0) { $pages--; } print "Pages:"; for ($i = 1; $i <= $pages; $i++) { $stl = ($i - 1) * 100; print "<a href='index.php?st=$stl'>$i</a> >"; } Link to comment https://forums.phpfreaks.com/topic/43935-list-the-pages/#findComment-213338 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.