I have some code in PHP and HTML, I'm trying to create a photo gallery, my function reads all the png/jpg/gif files in a folder then displays them on a table in my browser, this is my code.
<div class="container">
<div class="jumbotron">
<table class="table table-hover">
<?php
$contador = 1;
$directory="galeria";
$dirint = dir($directory);
while (($archivo = $dirint->read()) !== false){
if (eregi("gif", $archivo) || eregi("jpg", $archivo) || eregi("png", $archivo)){
if($contador == 5){
echo '</tr><tr>';
$contador = 1;
}
echo '<td valign="bottom"><img class="img-rounded" src="'.$directory."/".$archivo.'" width="250px"></td>';
$contador++;
}
}
$dirint->close();
?>
</table>
</div>
When running this file PHP gives me this error:
I only have two images in my folder (the same image, copied), why am I getting so many errors as if it was looping through a lot of files?