Skip to content

Instantly share code, notes, and snippets.

@codeforfun-jp
Last active December 6, 2021 04:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeforfun-jp/509fdb863288e891028f20f42ca602d2 to your computer and use it in GitHub Desktop.
Save codeforfun-jp/509fdb863288e891028f20f42ca602d2 to your computer and use it in GitHub Desktop.
Save Image File with PHP & MySQL - #5
<ul class="list-unstyled">
<?php for($i = 0; $i < count($images); $i++): ?>
<li class="media mt-5">
<a href="#lightbox" data-toggle="modal" data-slide-to="<?= $i; ?>">
<img src="image.php?id=<?= $images[$i]['image_id']; ?>" width="100" height="auto" class="mr-3">
</a>
<div class="media-body">
<h5><?= $images[$i]['image_name']; ?> (<?= number_format($images[$i]['image_size']/1000, 2); ?> KB)</h5>
<a href="javascript:void(0);"
onclick="var ok = confirm('削除しますか?'); if (ok) location.href='delete.php?id=<?= $images[$i]['image_id']; ?>'">
<i class="far fa-trash-alt"></i> 削除</a>
</div>
</li>
<?php endfor; ?>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment