I'm quite new to PHP. As a part of my learning process, I'm trying to show a list of images in a page, but unfortunately the images aren't showing !!!
I've saved my variables in a seperate file, in there I've saved the upload path, like below :
Code: Select all
define('MM_UPLOADPATH', 'images/');Code: Select all
while ($row = mysqli_fetch_array($data)) {
if (is_file(MM_UPLOADPATH . $row['picture']) && filesize(MM_UPLOADPATH . $row['picture']) > 0) {
echo '<tr><td><img src="' . MM_UPLOADPATH . $row['picture'] . '" alt="' . $row['first_name'] . '" /></td>';
}
else {
echo '<tr><td><img src="' . MM_UPLOADPATH . 'nopic.jpg' . '" alt="' . $row['first_name'] . '" /></td>';
}
echo '<td>' . $row['first_name'] . '</td></tr>';
}It seems everything is okay to me, but unfortunately the images are missing when I'm accessing the page via a browser (please check the attached screenshot)
I'd be really grateful if anyone could help me to solve this issue.
Thanks in advance.