Just off the top of my head, shouldn't the 2nd line refer to $fp?
$fp = fopen("albumler/".$album."/resim.txt","r");
$array = file("albumler/".$album."/resim.txt");
Shouldn't it be:
$fp = fopen("albumler/".$album."/resim.txt","r");
$array = file($fp);
That might fix something.
The 2nd thing I noticed is your while loop. You don't have any '{' or '}' in there. So your while loop loops, but all it does is increment $i. I think you want to increment $i and issue the echo statement as well. The code would be:
while (substr($array[$i],0,strlen($resim)) != substr($resim,0,strlen($resim)) && $i<=count($array))
{
$i++;
echo "<b>".substr($array[$i],strlen($resim))."</b>";
} // end while (substr($array[$i],0,strlen($resim)) != substr($resim,0,strlen($resim)) && $i<=count($array))