@future
Ich hoffe ich darf auch posten ;-)
wenn ich dein Script richtig lese speicherst du das
gesamte Verzeichnis in
$arrdir ab.
Danach willst du nach
$datei suchen.
also:
erweitere dein
IF
um eine weitere Variable.
PHP-Code:
$a=$id;
$b='.jpg';
$datei=($a.$b);
$path="/produktfotos";
$handle=opendir($path);
$standardbild = "stand.jpg";
$anzeige = 0;
while ($arrdir[] = readdir($handle)) {}
closedir($handle);
sort($arrdir);
foreach($arrdir as $file)
{
if($file == $datei)
{
echo "<img src='produktfotos/".$id.".jpg' vspace='5' hspace='5'></td>";
$anzeige++;
}
}
if ($anzeige == 0)
echo "<img src='$standardbild' vspace='5' hspace='5'></td>";