thank you kindly for your reply. i definitely need to look into that.
now that i am pondering my code, i think i need it to do a little more because i want it to be very portable.
what i am making is a script that displays thumbnails, and when clicked, the page shows only the fullsize image with "next, home, previous" at the bottom
here is the a href tag that is on each image:
<a href="pics.php?pic=2">
i then have this if statement
<?php
if($pic) {
?>
<center><img src="images/<?php echo "$pic"; ?>.jpg" width=500 height=666>
<?php
$totalpics=7;
$prev=$pic-1;
$next=$pic+1;
?>
to show the images. the problem with this is,
1)if i want to remove an image, say image 3, the "next" and "previous" buttons will not work correctly- they'll be looking for an image that isnt there.
2) i dont like hardcoding total pics in, which is why i asked for the dir count.
i was thinking, a better way to do this would be to read the directory, making each image a part of an array (like images[1] would equal the first image name, etc) and then I can make calls to that instead of having to number everything out. ok, i know this is probably confusing, hell, i am confused. but my question now is, is there a way to read a dir and make an array of all the files in the dir?
thanks!