Otrzymuje komunikat: "Parse error: syntax error, unexpected 'endforeach' (T_ENDFOREACH) in /var/www/dev/web/galeria.php on line 47"
Niestety nie mam pojęcie dlaczego ten bład...
Mój kod wyglada tak:
<!DOCTYPE html> <html> <head> <title>Galeria</title> </head> <?php require_once 'functions.php'; $db = get_db(); $zdjecie = $db->zdjecie->find(); $sciezka = $_SERVER['DOCUMENT_ROOT'].'/images/miniaturka/'; $i = 0; ?> <body> <table> <thead> <tr> <th>Zdjecie</th> <th>Autor</th> <th>Tytuł</th> </tr> </thead> <tbody> <?php if ($zdjecie->count()): ?> <?php foreach ($zdjecie as $zdjecie): ?> <tr> <td> <?php if ( $parts['extension'] == 'jpg' ) { echo '<a target="_blank" href="/images/real/'.$zdjecie['nazwa'].'"><img src="images/miniaturka/'.$zdjecie['nazwa'].'"/></a>'; } if ( $parts['extension'] == 'png' ) { echo '<a target="_blank" href="/images/real/'.$zdjecie['nazwa'].'"><img src="images/miniaturka/'.$zdjecie['nazwa'].'"/></a>'; ?> } </td> <td>Autor: <?= $zdjecie['autor'] ?> </td> <td>Tytuł: <?= $zdjecie['tytul'] ?></td> </tr> <?php endforeach ?> </tbody> </table> </body> </html>