wmguk Posted August 24, 2007 Share Posted August 24, 2007 this is my script <?php $login = $_GET['login']; $dir = strtolower($login); $ceremony = $_GET['ceremony']; $counters = $_GET['counters']; // Make Connection include '../scripts/connection.php'; if (!$con) { die('Could not connect: ' . mysql_error() ); } mysql_select_db($db, $con); //Run the update query $sql = "UPDATE album SET counters = '$counters' WHERE login = '$dir'"; mysql_query( $sql , $con ) or die( "<strong>Query Error</strong>: " . mysql_error() . "<br><strong>Query</strong>: $sql<br><br>" ); //Close the connection mysql_close($con); $NBFile=0; $dir ="../../clients/$dir"; if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { //if (substr($file, strlen($file)-3, 3)=="jpg" ) { $FileArray[] = $dir."/".$file; $NBFile=$NBFile+1; //} } } } closedir($handle); ?> this is the HTML <table align="center"><tr> <?php $NBPicswidth=1; $NBPics=0; for ($i=0; $i<$NBFile; $i++) { $Pic_Name1=$FileArray[$i]; ?><td> <a href="dis.php?image=<?php echo $Pic_Name1; ?>&ceremony=<? echo $ceremony; ?>&login=<? echo $login; ?>" target="order"><img src="<?php echo $Pic_Name1; ?>" width="120" border="1" align="middle" class="main"></a> <hr width="90%" /></td><?php $NBPics=$NBPics+1; if ( $NBPics==$NBPicswidth ) { $NBPics=0; ?> <tr><?php } } ?></table> is there anyway to view these in order using the name of the image? Link to comment https://forums.phpfreaks.com/topic/66439-order-thumbnails-by-image-name/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.