Skip to content

Instantly share code, notes, and snippets.


codingwithsara/list.php Secret

Created Apr 2, 2019
What would you like to do?
Save Image File with PHP & MySQL - 1. HTML
<!DOCTYPE html>
<html lang="ja">
<meta charset="utf-8">
<title>Image Test</title>
<link rel="stylesheet" href="" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
<div class="container mt-5">
<div class="row">
<div class="col-md-8 border-right">
<ul class="list-unstyled">
<?php for ($i = 0; $i < 3; $i ++): ?>
<li class="media mt-5">
<a href="#lightbox" data-toggle="modal" data-slide-to="<?= $i; ?>">
<img src="cat.jpg" width="100px" height="auto" class="mr-3">
<div class="media-body">
<h5>Cat.jpg (123.45KB)</h5>
<a href="#"><i class="far fa-trash-alt"></i> 削除</a>
<?php endfor; ?>
<div class="col-md-4 pt-4 pl-4">
<form method="post" enctype="multipart/form-data">
<div class="form-group">
<input type="file" name="image" required>
<button type="submit" class="btn btn-primary">保存</button>
<div class="modal carousel slide" id="lightbox" tabindex="-1" role="dialog" data-ride="carousel">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-body">
<ol class="carousel-indicators">
<?php for ($i = 0; $i < 3; $i++): ?>
<li data-target="#lightbox" data-slide-to="<?= $i; ?>" <?php if ($i == 0) echo 'class="active"'; ?>></li>
<?php endfor; ?>
<div class="carousel-inner">
<?php for ($i = 0; $i < 3; $i++): ?>
<div class="carousel-item <?php if ($i == 0) echo 'active'; ?>">
<img src="cat.jpg" class="d-block w-100">
<?php endfor; ?>
<a class="carousel-control-prev" href="#lightbox" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
<a class="carousel-control-next" href="#lightbox" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
<script src="" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment