while(false !== ($file = readdir($dp))){
well, from what i can tell.. its supposed to stop if the file is not open for reading or something... if u only want it to run once on that file.. why not do a simple inrement while loop?
loopcounter = 0
do
{
if($file != "." && $file != ".."){
if($appfile = 'apr_' . $file){
echo "<a href=\"finsmplreq.php?fid=$file\">file approved</a><br>";
}else{
echo "<a href=\"finsmplreq.php?fid=$file\">file</a><br>";
}
}
$loopcounter++;
} while ($loopcounter = 0);
that will run it once, and u'll have to add other vars, or whatever...
another idea.. what is your first while loop returning on the second run through?
while(false !== ($file = readdir($dp))){
is it returning false or what...
u might try
$file != readdir($dp)
i've never really played much with file functions but, i'm assuming u'r writing that wrong just by looking at it.