blueman378 Posted March 25, 2008 Share Posted March 25, 2008 hi guys well heres the code im using: <?php echo "<div class=\"details\"><form method=\"post\" action=\"{$_SERVER['PHP_SELF']}?action=avatar\">"; echo "<select name=\"cat\">"; $dir = "avatars/"; if ($handle = opendir($dir)) { if ($handle != "." && $handle != "..") { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { ?> <option <?php if($file == $_POST[cat]){?>selected = "selected" <?php } ?> value="<?php echo $file; ?>"><?php echo $file; ?></option> <?php } } } } closedir($handle); echo "</select><input type=\"submit\" value=\"Load\" class=\"button\"></form></div>"; if (!isset($_POST['cat'])) { echo "Please select an avatar category"; } else { echo "<table width=\"100%\" cellspacing=\"15%\">"; echo "<tr>"; $dir2 = "avatars/{$_POST[cat]}"; // Open a known directory, and proceed to read its contents if ($dh = opendir($dir2)) { $i= "1"; while (($file = readdir($dh)) !== false) { if ($file != "." && $file != "..") { if ($i == "6") {echo "</tr><tr>"; $i = "1";} echo "<td><img border=\"1\" src=\"{$dir2}/{$file}\"></td>"; $i++; }} closedir($dh); echo "</tr></table>"; } } ?> the output is http://www.test.webspirited.com/webspirited/forum/?action=avatar which works fine, but what im wanting is a way to paginate the images? any ideas? 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.