ahhhhh cant get it to number the files how i want...instead of outputting something like
<option value="0">bike.jpg</option>
<option value="1">plain.jpg</option>
<option value="2">car.jpg</option>
it outputts
<option value="0">bike.jpg</option>
<option value="1">bike.jpg</option>
<option value="2">bike.jpg</option>
<option value="3">bike.jpg</option>
<option value="4">bike.jpg</option>
<option value="5">bike.jpg</option>
heres the snippet....please help
<?php
$dhandle = opendir($dirPath);
while ($filename = readdir($dhandle)) {
if ($filename != "." && $filename != "..") {
$num = 0;
while($num = 2){
$num++;
?>
<option value="<?php echo $num; ?>"><?php echo $filename; ?></option>
<?php
}
}
}
?>
i just want all the files to be listed with the value as 1, 2 ,3 ,4 and so on....please help