Search the Community
Showing results for tags 'resizing'.
-
Hi I'm trying to setup Pagination at the bottom of the page after showing 10 images in the following script but have no clue where to start and how to implement it into the script. I also need some help to make a rule where images should show not bigger than 800 x 600 and. Lastly I receive a line showing   at the bottom of the page and I have no Idea how to remove it... <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html"> <title>Show images in folder</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <br> <?php date_default_timezone_set("Africa/Harare"); $folder = 'img/'; $filetype = '*.*'; $files = glob($folder.$filetype); $count = count($files); $sortedArray = array(); for ($i = 0; $i < $count; $i++) { $sortedArray[date ('YmdHis', filemtime($files[$i])) . $i] = $files[$i]; } ksort($sortedArray); # krsort($sortedArray); echo '<table>'; foreach ($sortedArray as &$filename) { echo '<tr><td>'; echo '<a name="'.$filename.'" <br><img src="'.$filename.'" /></a>'; echo '<br>'; echo substr($filename,strlen($folder),strpos($filename, '.')-strlen($folder)); echo '</td></tr>'; } echo '</table>'; ?>
- 4 replies
-
- php
- pagination
-
(and 1 more)
Tagged with: