How do I delete files in a class?
Posted
by
user3682906
on Stack Overflow
See other posts from Stack Overflow
or by user3682906
Published on 2014-05-28T09:19:30Z
Indexed on
2014/05/28
9:24 UTC
Read the original article
Hit count: 185
I want to have a CRUD management on my gallery but I have no idea how. I have searched the internet but I did not find what I was looking for.
This is my class:
class Gallery {
public function renderImages($map)
{
$images = "";
foreach (glob($map ."*.{jpeg,jpg,png,gif}", GLOB_BRACE) as $image){
$images .= "<a href='".$image."' data-lightbox='afbeelding'><img src='".$image."' class='thumbnail'></img></a>";
}
return $images;
}
}
and this is my gallery:
<div class="gallery">
<center>
<a href="index.php">Back:</a>
<style>
body
{
margin:0;
padding:0;
background:#efefef;
font-family: "Helvetica Neue", helvetica, arial, sans-serif;
color: black;
text-align:center; /* used to center div in IE */
}
</style>
<?php
$gallery = new Gallery();
echo $gallery -> renderImages("../images/");
$connection = new DatabaseConnection();
$render = new RenderData();
$page = 1;
if(isset($_GET['page'])) {
$check = new CheckData();
if($check->PageCheck($_GET['page'])) {
$page = $_GET['page'];
}
}
?>
<table>
<div id="Intro">
<tr>
<td>Hieronder kan je uploaden.</td>
</tr>
</div>
<tr>
<td>Max. 500000000Bytes</td>
</tr>
<tr>
<form action="pages/upload_file.php" method="post" enctype="multipart/form-data">
<td><label for="file">Filename:</label></td>
</tr>
<tr>
<td><input type="file" name="file" id="file"></td>
</tr>
<tr>
<td><input type="submit" name="submit" value="Submit"></td>
</tr>
<tr>
<td><input type="submit" name="delete" value="Delete"></td>
</tr>
</form>
</table>
How do I make a CRUD management on this? I want to select the photo and then delete it from my computer.
I hope you guys can help me out...
© Stack Overflow or respective owner