hmmm well when u enter new pics u want to enter their file names into a database ( would be the best way ). you could make a upload phpfile that uploads the picture sticks thumbnail in thumb folder and a real picture in the pictures folder then adds a row into a database with the file name.
below it uses same filename but under two different folders
lets say you have a upload file that sticks the filename into a new row. so every picture u have is in the database!
<?php
// of course you have to connect to the database before the rest
/* GETS all the filenames from database and puts them into an array. You will want to limit this to a certain number per page. */
$query = "SELECT * FROM Pictures"; // get picarray
$result = mysql_query($query);
$picarray = mysql_fetch_row($result);
//now you count how many elements are in the array
$pic_count = count($picarray);
//counter for output of thumbnails
$picnum=0;
//start a main output loop
while($pic_count>$picnum) // trips out after last thumbnail
{
// pieces together filename and directory/path for LINK TO PIC
$L_MakePath = array('put full image directory here',$picarray[$picnum]); // gets the filename by array number
$L_picpath = implode("", $L_MakePath);
// pieces together filename and directory/path for thumbnail
$T_MakePath = array('put thumbnail directory here',$picarray[$picnum]); // gets the filename by array number
$T_picpath = implode("", $T_MakePath);
//output thumb nail as a link to the big picture
?>
<A HREF=<? echo $L_picpath; ?> ><IMG BORDER="0" SRC=<? echo $T_picpath; ?>></A>
<?php
//finally up counter
$picnum++;
} //END LOOP
?>
hope that helps 🙂
making a dynamic loop for output is great 😃 i use similar ones in my BB code except to output FORUMS, THREADS, POSTS