Okay, the subject might be a bit confusing. Basically, so far i've got a script thingy that allows it to read all files within a specified folder.. From there it then selects all with *.jpg... Problem is i need to select only a range of these pictures. Let's say thiers 99 pictures total. They're Numbered 1-99 (no 0 on front of the pictures). The user inputs 3, and it gets 3-11 (9 pictures). It always gets 9 - thats the magic number here heh. Okay! so! here's what i have so far:
<?php
$numhigh = $numlow + 8;
function numCount () {
for ( ; $numlow < $numhigh; $numlow++ ){}
}
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if ( ereg("numCount(.*).jpg", $file) ) {
for ( ; $numlow < $numhigh; $numlow++ )
{
print ("<img src='");
echo ($numlow);
echo ($file);
print (".jpg'>");
}
}
}
}
closedir($handle);
?>
$numlow is specified via a form.. and yes, i know its very sloppy. hint hint: noob forum 😛 a friend helped me with parts of it, but unfortunately, he hasnt been around much and even if he is he's very busy.. and also, i know the code repeats itself, but the thing is, i just dont understand how to get it to see $numlow*.jpg. 😐 I guess i could just rename all the files, but that'd be a pain in the butt 😛 After i get that done, I want to be able to make it loop over a text doc too.. but im not going to worry about that yet.