I used a free guestbook created by a student. On the submit.php page, there is the following codes for the selection (drop down) menu of pictures for user to choose.
The pictures are stored in "http://domain.com/image/face/...gif"PHP Code:<?
$data_file=opendir('./image/face');
while ($all_file=readdir($data_file)) {
if ($all_file==".") continue;
if ($all_file=="..") continue;
echo "<option value='image/face/".$all_file."'>$all_file</option>";
}
closedir($data_file);
?>
</select><img id="R1" src="image/face/paaa1.gif"></td>
</tr>
<?
$f=fopen("pn_list.dat","r");
$r=fread($f,filesize("pn_list.dat"));
$main=stripslashes($r);
?>
and the location with the name of the pictures are stored in pn_list.dat
(RHS:location of the picture;LHS:year the pictures were taken)
paaa1.gif∥<1998>
paaa2.gif∥<1998>
paaa3.gif∥<1998>
paaa4.gif∥<1998>
paaa5.gif∥<1998>
paab1.gif∥<1999>
paab2.gif∥<1999>
paab3.gif∥<1999>
paac1.gif∥<2000>
paac2.gif∥<2000>
paad1.gif∥<2001>
paad2.gif∥<2001>
paad3.gif∥<2001>
Could someone advise on how to modify the above script so that the pictures in the selection (drop down) menu of submit.php will appear in the above numerical/alphebetical sequence? Many thanks in advance.



Reply With Quote


Bookmarks