Skip to content

Instantly share code, notes, and snippets.

@codeforfun-jp
Created April 21, 2021 01:44
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/cc8ed72fa9fdab71ff153d293c7345d2 to your computer and use it in GitHub Desktop.
Save codeforfun-jp/cc8ed72fa9fdab71ff153d293c7345d2 to your computer and use it in GitHub Desktop.
Save Image File with PHP & MySQL - #4
<div class="modal-body">
<ol class="carousel-indicators">
<?php for ($i = 0; $i < count($images); $i++): ?>
<li data-target="#lightbox" data-slide-to="<?= $i; ?>" <?php if ($i == 0) echo 'class="active"'; ?>></li>
<?php endfor; ?>
</ol>
<div class="carousel-inner">
<?php for ($i = 0; $i < count($images); $i++): ?>
<div class="carousel-item <?php if ($i == 0) echo 'active'; ?>">
<img src="image.php?id=<?= $images[$i]['image_id']; ?>" class="d-block w-100">
</div>
<?php endfor; ?>
</div>
<a class="carousel-control-prev" href="#lightbox" role="button" data-slide="prev">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment